|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.graphml.input.ChildParseContext
public class ChildParseContext
An implementation of GraphMLParseContext
that delegates most calls to
a getParentContext()
, but adds the capability to locally add
lookup results
and
deserialization properties
.
Constructor Summary | |
---|---|
ChildParseContext(GraphMLParseContext parentContext)
Initializes a new instance of the ChildParseContext class
that delegates to the provided context. |
|
ChildParseContext(GraphMLParseContext parentContext,
java.lang.Object currentObject)
Initializes a new instance of the ChildParseContext class
that delegates to the provided context and adds the currentObject
to the getObjectStack() . |
Method Summary | |
---|---|
java.lang.Object |
deserialize(GraphMLParseContext context,
org.w3c.dom.Node targetNode,
java.lang.Class targetType)
Deserialize the Object representation in targetNode . |
java.lang.Object |
deserialize(org.w3c.dom.Node targetNode)
Deserialize the Object representation in targetNode . |
java.lang.Object |
getCurrentObject()
Returns the most current (i.e. the last element) within the container hierarchy as it is returned by GraphMLParseContext.getObjectStack() |
java.lang.Object |
getDeserializationProperty(java.lang.Object key)
Get a property value that specifies information about how to handle specific cases |
Graph |
getGraph()
Returns the currently active graph object. |
java.util.Collection |
getObjectStack()
Returns the current nesting of graphs and graph elements. |
GraphMLParseContext |
getParentContext()
Gets the parent context. |
ParseEventHandler |
getParseEvents()
Returns an implementation of ParseEventHandler that allows to subscribe to various
events in the parse process. |
java.lang.Object |
lookup(java.lang.Class type)
Returns an instance that implements the given type or null . |
void |
removeDeserializationProperty(java.lang.Object key)
Removes a previously set local deserialization property. |
void |
removeLookup(java.lang.Class t)
Removes a local lookup override that has been added |
void |
setDeserializationProperty(java.lang.Object key,
java.lang.Object value)
Sets the local deserialization property for the given key to the value. |
void |
setLookup(java.lang.Class t,
java.lang.Object value)
Adds another lookup result to the local lookup override. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChildParseContext(GraphMLParseContext parentContext, java.lang.Object currentObject)
ChildParseContext
class
that delegates to the provided context and adds the currentObject
to the getObjectStack()
.
parentContext
- The parent context.currentObject
- The current Object to add to the getObjectStack()
and assign
to getCurrentObject()
.getParentContext()
,
getObjectStack()
,
getCurrentObject()
public ChildParseContext(GraphMLParseContext parentContext)
ChildParseContext
class
that delegates to the provided context.
parentContext
- The parent context.getParentContext()
Method Detail |
---|
public GraphMLParseContext getParentContext()
public java.lang.Object lookup(java.lang.Class type)
Lookup
null
.
Typically, this method will be called in order to obtain a different view
or aspect of the current instance. This is quite similar to casting or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor
does it have to return the same instance any time. Additionally, it depends
on the type and context whether the instance returned stays up to date or
needs to be retrieved again for subsequent use.
lookup
in interface Lookup
type
- the type for which an instance shall be returned
null
public void setLookup(java.lang.Class t, java.lang.Object value)
t
- The class type for which the value should be registered.value
- The value to provide for queries to t
, needs to be assignable to that type.removeLookup(Class)
,
lookup(Class)
public void removeLookup(java.lang.Class t)
t
- The type key to remove.setLookup(Class,Object)
,
lookup(Class)
public java.util.Collection getObjectStack()
GraphMLParseContext
The list contains the user objects which correspond to the graphml elements which are ancestors of the current node in the DOM tree. The list is appended to at the start, i.e. the most current element is at list index 0.
getObjectStack
in interface GraphMLParseContext
public java.lang.Object getCurrentObject()
GraphMLParseContext
GraphMLParseContext.getObjectStack()
getCurrentObject
in interface GraphMLParseContext
public ParseEventHandler getParseEvents()
GraphMLParseContext
ParseEventHandler
that allows to subscribe to various
events in the parse process.
getParseEvents
in interface GraphMLParseContext
ParseEventHandler
implementation.public Graph getGraph()
GraphMLParseContext
getGraph
in interface GraphMLParseContext
public java.lang.Object getDeserializationProperty(java.lang.Object key)
getDeserializationProperty
in interface GraphMLParseContext
key
- The identifier for the property
null
if no such property exists.setDeserializationProperty(Object,Object)
,
removeDeserializationProperty(Object)
public void setDeserializationProperty(java.lang.Object key, java.lang.Object value)
key
- The key to override.value
- The value.getDeserializationProperty(Object)
,
removeDeserializationProperty(Object)
public void removeDeserializationProperty(java.lang.Object key)
key
- The key for which the local property override should be removed.getDeserializationProperty(Object)
,
setDeserializationProperty(Object,Object)
public java.lang.Object deserialize(GraphMLParseContext context, org.w3c.dom.Node targetNode, java.lang.Class targetType) throws GraphMLParseException
GraphMLParseContext
targetNode
.
This method is reserved for special use cases. Usually, you should just call GraphMLParseContext.deserialize(Node)
instead.
deserialize
in interface GraphMLParseContext
context
- The current parse context.targetNode
- The XML node that should be deserialized.targetType
- The type the result is expected to have, or null
if
deserialization handlers should determine this information automatically.
targetNode
GraphMLParseException
public java.lang.Object deserialize(org.w3c.dom.Node targetNode) throws GraphMLParseException
GraphMLParseContext
targetNode
.
deserialize
in interface GraphMLParseContext
targetNode
- The XML node that should be deserialized.
targetNode
GraphMLParseException
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |