public class GraphElementIdAcceptor extends Object implements IGraphElementIdAcceptor, IGraphElementResolver
IGraphElementIdAcceptor
and IGraphElementIdProvider
that stores all ids in IMapper
instances.Constructor and Description |
---|
GraphElementIdAcceptor() |
Modifier and Type | Method and Description |
---|---|
IGraphElementIdProvider |
createIdProvider(IGraphElementIdProvider fallback)
Factory method to create a default implementation of
IGraphElementIdProvider that delegates to fallback
and uses the values stored by this GraphElementIdAcceptor instance, if possible. |
Map<IEdge,String> |
getEdgeIds()
Return a mapping between all GraphML ids for
<edge> elements and the corresponding IEdge instances. |
Map<IGraph,String> |
getGraphIds()
Return a mapping between all GraphML ids for
<graph> elements and the corresponding IGraph instances. |
Map<INode,String> |
getNodeIds()
Return a mapping between all GraphML ids for
<node> elements and the corresponding INode instances. |
Map<IPort,String> |
getPortIds()
Return a mapping between all GraphML ids for
<port> elements and the corresponding IPort instances. |
IEdge |
resolveEdge(IParseContext context,
String id)
Resolve the GraphML
id to an IEdge instance. |
IGraph |
resolveGraph(IParseContext context,
String id)
Resolve the GraphML
id to an IGraph instance. |
INode |
resolveNode(IParseContext context,
String id)
Resolve the GraphML
id to an INode instance. |
IPort |
resolvePort(IParseContext context,
String ownerId,
String id)
Resolve the GraphML
id to an IPort instance. |
void |
storeId(IParseContext context,
IEdge edge,
String id)
Store the value of the id attribute for the given edge.
|
void |
storeId(IParseContext context,
IGraph graph,
String id)
Store the value of the id attribute for the given graph.
|
void |
storeId(IParseContext context,
INode node,
String id)
Store the value of the id attribute for the given node.
|
void |
storeId(IParseContext context,
IPort port,
String id)
Store the value of the id attribute for the given port.
|
public final IGraphElementIdProvider createIdProvider(IGraphElementIdProvider fallback)
IGraphElementIdProvider
that delegates to fallback
and uses the values stored by this GraphElementIdAcceptor
instance, if possible.fallback
- The fallback.public final Map<IEdge,String> getEdgeIds()
<edge>
elements and the corresponding IEdge
instances.public final Map<IGraph,String> getGraphIds()
<graph>
elements and the corresponding IGraph
instances.public final Map<INode,String> getNodeIds()
<node>
elements and the corresponding INode
instances.public final Map<IPort,String> getPortIds()
<port>
elements and the corresponding IPort
instances.public final IEdge resolveEdge(IParseContext context, String id)
IGraphElementResolver
id
to an IEdge
instance.resolveEdge
in interface IGraphElementResolver
context
- The current parse context.id
- The id that should be resolved.IEdge
that is defined by this GraphML id
, or null
if no such edge exists yet.public final IGraph resolveGraph(IParseContext context, String id)
IGraphElementResolver
id
to an IGraph
instance.resolveGraph
in interface IGraphElementResolver
context
- The current parse context.id
- The id that should be resolved.IGraph
that is defined by this GraphML id
, or null
if no such graph exists yet.public final INode resolveNode(IParseContext context, String id)
IGraphElementResolver
id
to an INode
instance.resolveNode
in interface IGraphElementResolver
context
- The current parse context.id
- The id that should be resolved.INode
that is defined by this GraphML id
, or null
if no such node exists yet.public final IPort resolvePort(IParseContext context, String ownerId, String id)
IGraphElementResolver
resolvePort
in interface IGraphElementResolver
context
- The current parse context.ownerId
- The GraphML id of the port owner.id
- The id that should be resolved.IPort
that is defined by the GraphML ids, or null
if no such port exists yet.public final void storeId(IParseContext context, IEdge edge, String id)
IGraphElementIdAcceptor
storeId
in interface IGraphElementIdAcceptor
context
- The current parse context.edge
- The current edge elementid
- The id of the edge's XML representationpublic final void storeId(IParseContext context, IGraph graph, String id)
IGraphElementIdAcceptor
storeId
in interface IGraphElementIdAcceptor
context
- The current parse context.graph
- The current graph elementid
- The id of the graph's XML representationpublic final void storeId(IParseContext context, INode node, String id)
IGraphElementIdAcceptor
storeId
in interface IGraphElementIdAcceptor
context
- The current parse context.node
- The current node elementid
- The id of the node's XML representationpublic final void storeId(IParseContext context, IPort port, String id)
IGraphElementIdAcceptor
storeId
in interface IGraphElementIdAcceptor
context
- The current parse context.port
- The current port elementid
- The id of the port's XML representation