|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphdrawing.graphml.reader.GraphMLParseContext
Defines the context within a factory method is invoked. The parsing context grants access to the nesting within the graph element creation occurs. Through the nesting, i.e., the graph is defined in which a node or edge is created. Subclasses usually also provide access to the attributes of the element which is responsible for the call of a factory method. A parse context is only valid within the factory mehtod to which it is passed. When the factory method is finished, the state of the corresponding parse context is undefined.
| Nested Class Summary | |
static interface |
GraphMLParseContext.ResourceDecoder
Interface for classes that decode GraphML input to objects |
static interface |
GraphMLParseContext.ResourceHandler
Interface for classes that provide methods to manage shared object resources for the parse process |
| Field Summary | |
static String |
PROPERTY_GRAPHML_CORE_NS
|
static String |
PROPERTY_YWORKS_EXT_NS
|
| Constructor Summary | |
protected |
GraphMLParseContext()
Creates an empty parse context. |
| Method Summary | |
abstract String |
getAttributeValue(String attrName)
Return the value of an XML attribute in the current parse state |
List |
getContainers()
Returns the current nesting of created graphs and graph elements. |
Object |
getCurrentContainer()
Return a reference to the topmost element on the current element stack. |
abstract GraphMLParseErrorHandler |
getErrorHandler()
Return a reference to an error handler that can be used to handle error conditions |
Object |
getProperty(String name)
Return the value of a property that has been set with setProperty(String,Object) |
Object |
getSecondToCurrentContainer()
Return a reference to the second to topmost element on the current element stack. |
Object |
lookup(Class c)
Retrieve an object that is indexed by class c.
|
void |
popGraphMLElement()
Remove the topmost graph element from the element stack. |
void |
pushGraphMLElement(Object element)
Used by the parser to update the current nesting. |
void |
setLookup(Class c,
Object o)
Store a new value in the lookup map |
void |
setProperty(String name,
Object o)
This can be used to set internal properties of the context that are usually handled by external facades. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String PROPERTY_YWORKS_EXT_NS
public static final String PROPERTY_GRAPHML_CORE_NS
| Constructor Detail |
protected GraphMLParseContext()
| Method Detail |
public void pushGraphMLElement(Object element)
element - the element to put on the top of the stackpublic void popGraphMLElement()
public List getContainers()
public Object getCurrentContainer()
public Object getSecondToCurrentContainer()
public Object lookup(Class c)
Lookupc.
The return value should be an instance of class c or a subclass.
lookup in interface Lookupc - The class for which we want an implementation
c.
public void setLookup(Class c,
Object o)
c - the class that is used as lookup keyo - an object that should be an implementation of cpublic abstract GraphMLParseErrorHandler getErrorHandler()
public abstract String getAttributeValue(String attrName)
attrName - the name of the attribute
attrName in the current parse state
public void setProperty(String name,
Object o)
name - The name of the propertyo - the valuepublic Object getProperty(String name)
setProperty(String,Object)
name - the name of the property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||