|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphdrawing.graphml.attr.AttributeInputHandler
This class handles parsing of the GraphML extensions defined in
the attribute module.
This class handles only the low-level parsing, the processing
of the attributes is forwarded to an instance of
AttributeFactory.
| Field Summary | |
protected AttributeFactory |
attributeFactory
|
protected String |
defaultValue
|
protected String |
name
|
protected int |
scope
|
| Constructor Summary | |
AttributeInputHandler(String attrName,
AttributeFactory attributeFactory)
Creates a new input handler for a given attribute. |
|
AttributeInputHandler(String name,
AttributeFactory attributeFactory,
int scope)
|
|
| Method Summary | |
boolean |
acceptKey(NamedNodeMap attributes,
int scopeType)
Tests if the provided key/data pair defines an attribute. |
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. |
void |
setAttributeFactory(AttributeFactory attributeFactory)
Sets the current AttributeFactory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected AttributeFactory attributeFactory
protected String name
protected String defaultValue
protected int scope
| Constructor Detail |
public AttributeInputHandler(String attrName,
AttributeFactory attributeFactory)
attrName - the name of the attribute.
public AttributeInputHandler(String name,
AttributeFactory attributeFactory,
int scope)
| Method Detail |
public void setAttributeFactory(AttributeFactory attributeFactory)
AttributeFactory.
attributeFactory -
public boolean acceptKey(NamedNodeMap attributes,
int scopeType)
acceptKey in interface DOMInputHandlerattributes - 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.
true, if the the provided key
is an attribute
public void parseData(DOMGraphMLParseContext context,
boolean defaultMode,
Node node)
parseData in interface DOMInputHandlercontext - the current parse context.defaultMode - true when the default value of
included int the key element is processed,
false otherwise.node - the DOM node representing the data element.public void applyDefault(DOMGraphMLParseContext context)
DOMInputHandler
applyDefault in interface DOMInputHandlercontext - the current parse context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||