Search this API

y.io.graphml.graph2d
Class ShapeNodeRealizerSerializer

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

public class ShapeNodeRealizerSerializer
extends AbstractNodeRealizerSerializer

Serializer for instances of ShapeNodeRealizer.


Constructor Summary
ShapeNodeRealizerSerializer()
           
 
Method Summary
protected  byte decodeShapeType(String s, GraphMLParseContext context)
          Returns a shape type that is represented by s.
protected  String encodeShapeType(ShapeNodeRealizer snr, GraphMLWriteContext context)
          Returns a string describing the shape type that is used by snr.
 String getName()
          Returns the string ShapeNode.
 String getNamespaceURI()
          Returns the target namespace of the toplevel element
 Class getRealizerClass()
          Returns class ShapeNodeRealizer.
 void parse(NodeRealizer realizer, Node domNode, GraphMLParseContext context)
          Parses the properties into an instance of NodeRealizer.
 void write(NodeRealizer realizer, XmlWriter writer, GraphMLWriteContext context)
          Writes the realizer element's content.
 
Methods inherited from class y.io.graphml.graph2d.AbstractNodeRealizerSerializer
canHandle, canHandle, createRealizerInstance, getNamespacePrefix, parseLabel, parseNodePorts, writeAttributes, writeFill, writeNodeLabel, writeNodePorts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeNodeRealizerSerializer

public ShapeNodeRealizerSerializer()
Method Detail

getName

public String getName()
Returns the string ShapeNode.

Returns:
The name of the XML element

getNamespaceURI

public 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 Class getRealizerClass()
Returns class ShapeNodeRealizer.

Returns:
The target class of the realizer

write

public void write(NodeRealizer realizer,
                  XmlWriter writer,
                  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
Throws:
GraphMLWriteException
Parameters:
realizer - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.

encodeShapeType

protected String encodeShapeType(ShapeNodeRealizer snr,
                                 GraphMLWriteContext context)
Returns a string describing the shape type that is used by snr.

Parameters:
snr -
Returns:
A string describing the shape type that is used by snr.

parse

public void parse(NodeRealizer realizer,
                  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
Throws:
GraphMLParseException
Parameters:
realizer - An existing NodeRealizer instance which is configured.
domNode - The XML node containing the realizer data.
context - The current parse context.

decodeShapeType

protected byte decodeShapeType(String s,
                               GraphMLParseContext context)
Returns a shape type that is represented by s. It is up to the caller to interpret the return value correctly.

Parameters:
s - the String to decode
Returns:
A shape type that is represented by s.

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