|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yworks.yfiles.server.graphml.flexio.DefaultReferenceResolver
Default implementation of a ReferenceResolver that resolves external or internal references.
By default, only internal references that are declared in the GraphML document are resolved. To resolve
external references, the onResolveExternalOverrideReference(ResolveReferenceEvent) and
onResolveExternalFallbackReference(ResolveReferenceEvent) callbacks can be used.
| Constructor Summary | |
DefaultReferenceResolver()
Initializes a new instance. |
|
DefaultReferenceResolver(java.util.HashMap xmlReferenceMap)
Create a new Resolver instance Dictionary that has pairs where the key is a id string and
the value is the corresponding node from the sharedData section in the GraphML input. |
|
| Method Summary | |
void |
addReferenceElement(java.lang.String id,
org.w3c.dom.Node element)
Add a reference node for the given refid. |
org.w3c.dom.Node |
getReferenceElement(java.lang.String id)
Returns the XML element with the provided id, or null, if
no XML element with the provided id was contained in the shared data section. |
protected void |
onResolveExternalFallbackReference(ResolveReferenceEvent evt)
Resolve external references, if they couldn't be resolved using onResolveExternalOverrideReference(ResolveReferenceEvent)
or onResolveInternalReference(ResolveReferenceEvent, DeserializationHandler). |
protected void |
onResolveExternalOverrideReference(ResolveReferenceEvent evt)
Resolve an external reference. |
protected void |
onResolveInternalReference(ResolveReferenceEvent event,
DeserializationHandler deserializer)
Resolve inline references. |
java.lang.Object |
resolveReference(GraphMLParseContext context,
java.lang.String refid)
Convenience method that calls resolveReference(y.io.graphml.input.GraphMLParseContext, String, y.io.graphml.input.DeserializationHandler)
with a null deserializer. |
java.lang.Object |
resolveReference(GraphMLParseContext context,
java.lang.String refid,
DeserializationHandler deserializer)
Resolve an xml node to an object instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultReferenceResolver(java.util.HashMap xmlReferenceMap)
Dictionary that has pairs where the key is a id string and
the value is the corresponding node from the sharedData section in the GraphML input. It is the
caller's responsibility to ensure this is setup correctly.
xmlReferenceMap - public DefaultReferenceResolver()
| Method Detail |
public void addReferenceElement(java.lang.String id,
org.w3c.dom.Node element)
ReferenceResolver
addReferenceElement in interface ReferenceResolverid - The reference idelement - DOM node that is referenced by the id.public org.w3c.dom.Node getReferenceElement(java.lang.String id)
SharedReferenceElementProvidernull, if
no XML element with the provided id was contained in the shared data section.
getReferenceElement in interface SharedReferenceElementProvider
public java.lang.Object resolveReference(GraphMLParseContext context,
java.lang.String refid)
throws GraphMLParseException
resolveReference(y.io.graphml.input.GraphMLParseContext, String, y.io.graphml.input.DeserializationHandler)
with a null deserializer.
context - The current parse context.refid - The refid of the shared element.
GraphMLParseExceptionresolveReference(y.io.graphml.input.GraphMLParseContext, String, y.io.graphml.input.DeserializationHandler)
public java.lang.Object resolveReference(GraphMLParseContext context,
java.lang.String refid,
DeserializationHandler deserializer)
throws GraphMLParseException
ReferenceResolverThis method returns shared instances for nodes with the same refid.
resolveReference in interface ReferenceResolvercontext - The current parse context.refid - The refid which should be resolved. Must not be null.deserializer - Deserializer which should be used for deserialization of the shared element.
Can be null when not called from a deserializer instance, in
which case the resolver tries to find a matching deserializer itself.
GraphMLParseException
protected void onResolveInternalReference(ResolveReferenceEvent event,
DeserializationHandler deserializer)
throws GraphMLParseException
This method is only called if onResolveExternalOverrideReference(ResolveReferenceEvent) could not already
resolve the reference.
event - The current invocation state. Any event handler that can actually dereference the
reference should set the value using
ResolveReferenceEvent.setValue(Object)deserializer - The deserializer that is to be used for deserialization of the shared element, or nulls
GraphMLParseExceptionprotected void onResolveExternalOverrideReference(ResolveReferenceEvent evt)
evt - The current invocation state. Any event handler that can actually dereference the
reference should set the value using ResolveReferenceEvent.setValue(Object)protected void onResolveExternalFallbackReference(ResolveReferenceEvent evt)
onResolveExternalOverrideReference(ResolveReferenceEvent)
or onResolveInternalReference(ResolveReferenceEvent, DeserializationHandler).
evt - The current invocation state. Any event handler that can actually dereference the
reference should set the value using ResolveReferenceEvent.setValue(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||