Search this API

y.io.graphml.graph2d
Class GenericNodeRealizerSerializer

java.lang.Object
  extended by y.io.graphml.graph2d.AbstractNodeRealizerSerializer
      extended by y.io.graphml.graph2d.GenericNodeRealizerSerializer
All Implemented Interfaces:
NodeRealizerSerializer
Direct Known Subclasses:
GenericGroupNodeRealizerSerializer

public class GenericNodeRealizerSerializer
extends AbstractNodeRealizerSerializer

Serializer for instances of GenericNodeRealizer.

 

Nested Class Summary
static interface GenericNodeRealizerSerializer.ConfigurationFactory
          Interface for dynamic creation and registration of configurations for GenericNodeRealizer.
 
Constructor Summary
GenericNodeRealizerSerializer()
           
 
Method Summary
 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
protected  ObjectStringConverter getObjectStringConverter()
          Gets the ObjectStringConverter that will be used by this instance to convert the GenericNodeRealizer.getUserData() and GenericNodeRealizer.getStyleProperties() style properties to strings for serialization.
 java.lang.Class getRealizerClass()
          Returns the class of which the realizer is an instance of.
 void parse(NodeRealizer realizer, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the properties into an instance of NodeRealizer.
protected  void parseStyleProperties(GenericNodeRealizer gnr, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the style properties section of this realizer and assigns the user data object.
protected  void parseUserData(GenericNodeRealizer gr, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the user data section of this realizer and assigns the user data object.
 void write(NodeRealizer realizer, XmlWriter ipw, GraphMLWriteContext context)
          Writes the realizer element's content.
 void writeAttributes(NodeRealizer realizer, XmlWriter writer, GraphMLWriteContext context)
          Writes the attributes of an NodeRealizer element.
protected  void writeStyleProperties(GenericNodeRealizer gnr, XmlWriter writer, GraphMLWriteContext context)
          Writes the style properties section of this realizer and serializes the properties
protected  void writeUserData(GenericNodeRealizer gnr, XmlWriter writer, GraphMLWriteContext context)
          Writes the user data section of this realizer and writes the user data object.
 
Methods inherited from class y.io.graphml.graph2d.AbstractNodeRealizerSerializer
canHandle, canHandle, createRealizerInstance, getNamespacePrefix, parseLabel, parseNodePorts, writeBorder, writeFill, writeNodeLabel, writeNodePorts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericNodeRealizerSerializer

public GenericNodeRealizerSerializer()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: NodeRealizerSerializer
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: NodeRealizerSerializer
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: NodeRealizerSerializer
Returns the class of which the realizer is an instance of.

Returns:
The target class of the realizer

writeAttributes

public void writeAttributes(NodeRealizer realizer,
                            XmlWriter writer,
                            GraphMLWriteContext context)
Description copied from interface: NodeRealizerSerializer
Writes the attributes of an NodeRealizer element.

Specified by:
writeAttributes in interface NodeRealizerSerializer
Overrides:
writeAttributes in class AbstractNodeRealizerSerializer
Parameters:
realizer - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.

write

public void write(NodeRealizer realizer,
                  XmlWriter ipw,
                  GraphMLWriteContext context)
           throws GraphMLWriteException
Description copied from interface: NodeRealizerSerializer
Writes the realizer element's content.

Specified by:
write in interface NodeRealizerSerializer
Overrides:
write in class AbstractNodeRealizerSerializer
Parameters:
realizer - The Realizer to write.
ipw - The XmlWriter for the serialization.
context - The current write context.
Throws:
GraphMLWriteException

writeUserData

protected void writeUserData(GenericNodeRealizer gnr,
                             XmlWriter writer,
                             GraphMLWriteContext context)
                      throws GraphMLWriteException
Writes the user data section of this realizer and writes the user data object.

Throws:
GraphMLWriteException

writeStyleProperties

protected void writeStyleProperties(GenericNodeRealizer gnr,
                                    XmlWriter writer,
                                    GraphMLWriteContext context)
                             throws GraphMLWriteException
Writes the style properties section of this realizer and serializes the properties

Throws:
GraphMLWriteException
See Also:
getObjectStringConverter()

getObjectStringConverter

protected ObjectStringConverter getObjectStringConverter()
Gets the ObjectStringConverter that will be used by this instance to convert the GenericNodeRealizer.getUserData() and GenericNodeRealizer.getStyleProperties() style properties to strings for serialization.

Returns:
The value of ObjectStringConversion.getInstance().

parse

public void parse(NodeRealizer realizer,
                  org.w3c.dom.Node domNode,
                  GraphMLParseContext context)
           throws GraphMLParseException
Description copied from interface: NodeRealizerSerializer
Parses the properties into an instance of NodeRealizer.

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

parseStyleProperties

protected void parseStyleProperties(GenericNodeRealizer gnr,
                                    org.w3c.dom.Node domNode,
                                    GraphMLParseContext context)
                             throws GraphMLParseException
Parses the style properties section of this realizer and assigns the user data object.

Throws:
GraphMLParseException

parseUserData

protected void parseUserData(GenericNodeRealizer gr,
                             org.w3c.dom.Node domNode,
                             GraphMLParseContext context)
                      throws GraphMLParseException
Parses the user data section of this realizer and assigns the user data object.

Throws:
GraphMLParseException

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