Search this API

y.io.graphml.graph2d
Class FallbackEdgeRealizerSerializer

java.lang.Object
  extended by y.io.graphml.graph2d.AbstractEdgeRealizerSerializer
      extended by y.io.graphml.graph2d.FallbackEdgeRealizerSerializer
All Implemented Interfaces:
EdgeRealizerSerializer

public final class FallbackEdgeRealizerSerializer
extends AbstractEdgeRealizerSerializer

Fallback implementation of AbstractEdgeRealizerSerializer that deserializes common EdgeRealizer properties from arbitrary EdgeRealizer XML content. This includes geometry and labels.

 
Your browser does not support SVG content.

Method Summary
 boolean canHandle(EdgeRealizer er, GraphMLWriteContext context)
          Returns true iff er.getClass() == getRealizerClass().
 EdgeRealizer createRealizerInstance(org.w3c.dom.Node node, GraphMLParseContext context)
          Create new instance of the Realizer from the given information
static FallbackEdgeRealizerSerializer getInstance()
           
 java.lang.String getName()
          Returns the name of the XML element tag which denotes this type of realizer.
 java.lang.String getNamespaceURI()
          Returns the target namespace of the toplevel element
 java.lang.Class getRealizerClass()
          Returns the class of which the realizer is an instance of.
 void parse(EdgeRealizer er, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the properties from an instance of EdgeRealizer.
 void write(EdgeRealizer edgeRealizer, XmlWriter writer, GraphMLWriteContext context)
          Writes the realizer element's content.
 
Methods inherited from class y.io.graphml.graph2d.AbstractEdgeRealizerSerializer
canHandle, getNamespacePrefix, parseLabel, parsePort, writeAttributes, writeEdgeLabel, writePort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FallbackEdgeRealizerSerializer getInstance()

getName

public java.lang.String getName()
Description copied from interface: EdgeRealizerSerializer
Returns the name of the XML element tag which denotes this type of realizer.

Returns:
The name of the XML element

getNamespaceURI

public java.lang.String getNamespaceURI()
Description copied from interface: EdgeRealizerSerializer
Returns the target namespace of the toplevel element

Returns:
the target namespace of the toplevel element

getRealizerClass

public java.lang.Class getRealizerClass()
Description copied from interface: EdgeRealizerSerializer
Returns the class of which the realizer is an instance of.

Returns:
The target class of the realizer

parse

public void parse(EdgeRealizer er,
                  org.w3c.dom.Node domNode,
                  GraphMLParseContext context)
           throws GraphMLParseException
Description copied from class: AbstractEdgeRealizerSerializer
Parses the properties from an instance of EdgeRealizer.

Specified by:
parse in interface EdgeRealizerSerializer
Overrides:
parse in class AbstractEdgeRealizerSerializer
Parameters:
er - An existing EdgeRealizer instance which is configured.
domNode - The XML node containing the realizer data.
context - The current parse context.
Throws:
GraphMLParseException

write

public void write(EdgeRealizer edgeRealizer,
                  XmlWriter writer,
                  GraphMLWriteContext context)
           throws GraphMLWriteException
Description copied from interface: EdgeRealizerSerializer
Writes the realizer element's content.

Specified by:
write in interface EdgeRealizerSerializer
Overrides:
write in class AbstractEdgeRealizerSerializer
Parameters:
edgeRealizer - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.
Throws:
GraphMLWriteException

canHandle

public boolean canHandle(EdgeRealizer er,
                         GraphMLWriteContext context)
Description copied from class: AbstractEdgeRealizerSerializer
Returns true iff er.getClass() == getRealizerClass().

Specified by:
canHandle in interface EdgeRealizerSerializer
Overrides:
canHandle in class AbstractEdgeRealizerSerializer
Parameters:
er - The Realizer that my be written
context - The current write context
Returns:
true iff er.getClass() == getRealizerClass().

createRealizerInstance

public EdgeRealizer createRealizerInstance(org.w3c.dom.Node node,
                                           GraphMLParseContext context)
                                    throws GraphMLParseException
Description copied from interface: EdgeRealizerSerializer
Create new instance of the Realizer from the given information

Specified by:
createRealizerInstance in interface EdgeRealizerSerializer
Overrides:
createRealizerInstance in class AbstractEdgeRealizerSerializer
Parameters:
node - The DOM node that represents the realizer data.
context - The current parse context.
Returns:
new instance of the Realizer
Throws:
GraphMLParseException

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.