org.graphdrawing.graphml.reader.dom
Interface DOMInputHandler

All Known Implementing Classes:
AbstractDOMInputHandler, AttributeInputHandler, ReadPortLayoutHandler

public interface DOMInputHandler

This class defines a handler for key/data elements. To process module specific content defined by key/data elements, implement a DOMInputHandler and register it by the parser.


Method Summary
 boolean acceptKey(NamedNodeMap attributes, int scopeType)
          This method defines whether a specific key/data pair is handled by the input handler.
 void applyDefault(DOMGraphMLParseContext context)
          This method is invoked when no data tag is defined, and the default value should be applied.
 void parseData(DOMGraphMLParseContext context, boolean defaultMode, Node node)
          This method is invoked, each time a data element with matching key is processed.
 

Method Detail

acceptKey

public boolean acceptKey(NamedNodeMap attributes,
                         int scopeType)
This method defines whether a specific key/data pair is handled by the input handler. When it returns true, each occurence of data elements which match the id of the key element are forwarded to the input handler.

Parameters:
attributes - the attributes of the key tag.
scopeType - the scope for which the key is defined. One of GraphMLConstants.SCOPE_ALL, GraphMLConstants.SCOPE_EDGE, GraphMLConstants.SCOPE_ENDPOINT, GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE, GraphMLConstants.SCOPE_PORT, GraphMLConstants.SCOPE_HYPEREDGE.

parseData

public void parseData(DOMGraphMLParseContext context,
                      boolean defaultMode,
                      Node node)
This method is invoked, each time a data element with matching key is processed.

Parameters:
context - the current parse context.
defaultMode - true when the default value, which is included in the key element, is processed, false otherwise.
node - the DOM node representing the data element.

applyDefault

public void applyDefault(DOMGraphMLParseContext context)
This method is invoked when no data tag is defined, and the default value should be applied.

Parameters:
context - the current parse context.


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