Search this API

y.io.gml
Class NodeGraphicsParser

java.lang.Object
  extended by y.io.gml.ItemParser
      extended by y.io.gml.NodeGraphicsParser
All Implemented Interfaces:
GMLTokenizer.Callback

public class NodeGraphicsParser
extends ItemParser

This class will parse the node graphics section from a valid GML file and create appropriate NodeRealizers


Field Summary
 
Fields inherited from class y.io.gml.ItemParser
attributes, childMap, delegate, level
 
Constructor Summary
NodeGraphicsParser(URL contextURL)
           
 
Method Summary
 void begin()
          this method will be called as soon as the parser enters the scope.
 void beginScope(String scopeName)
          Note: subclass implementers should make a super call, if they want to overwrite this method.
 void end()
          this method will be called as soon as the parser leaves the scope.
 Object getItem()
          Returns the "product" of this scope.
 NodeRealizer getNodeRealizer()
          Gets the node realizer that is the result of this parsing process.
static byte getShape(String name)
          Decodes a ShapeNodeRealizer.getShapeType() given a String representation.
protected  URL getURL(String resource, URL contextURL)
          Tries to resolve an resource as an URL using a given context URL.
 
Methods inherited from class y.io.gml.ItemParser
addAttribute, addChild, attribute, attribute, childFinished, endScope, getAttributes, getBoolean, getDouble, getDouble, getInt, getInt, getLevel, getString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeGraphicsParser

public NodeGraphicsParser(URL contextURL)
Method Detail

beginScope

public void beginScope(String scopeName)
Description copied from class: ItemParser
Note: subclass implementers should make a super call, if they want to overwrite this method.

Specified by:
beginScope in interface GMLTokenizer.Callback
Overrides:
beginScope in class ItemParser
Parameters:
scopeName - the name of the scope

begin

public void begin()
Description copied from class: ItemParser
this method will be called as soon as the parser enters the scope. This implementation will clear the attribute map. Subclasses should therefore make a super call.

Overrides:
begin in class ItemParser

end

public void end()
Description copied from class: ItemParser
this method will be called as soon as the parser leaves the scope. This implementation does nothing. Subclasses should nevertheless make a super call.

Overrides:
end in class ItemParser

getURL

protected URL getURL(String resource,
                     URL contextURL)
Tries to resolve an resource as an URL using a given context URL.


getNodeRealizer

public NodeRealizer getNodeRealizer()
Gets the node realizer that is the result of this parsing process.


getItem

public Object getItem()
Description copied from class: ItemParser
Returns the "product" of this scope. This method should be called after this parser has left the scope, i.e. after ItemParser.end() has been called. The latter should construct the resulting item from the collected data and this item should be returned by this method. By default, this method return the map of the attributes.

Overrides:
getItem in class ItemParser
Returns:
the result of the parsing, in this case a Map

getShape

public static byte getShape(String name)
Decodes a ShapeNodeRealizer.getShapeType() given a String representation.


© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.