Search this API

y.io.graphml.graph2d
Interface EdgeRealizerSerializer

All Known Implementing Classes:
AbstractEdgeRealizerSerializer, ArcEdgeRealizerSerializer, BezierEdgeRealizerSerializer, FallbackEdgeRealizerSerializer, GenericEdgeRealizerSerializer, PolyLineEdgeRealizerSerializer, QuadCurveEdgeRealizerSerializer, SplineEdgeRealizerSerializer

public interface EdgeRealizerSerializer

Interface for serializing instances of EdgeRealizer.


Method Summary
 boolean canHandle(EdgeRealizer er, GraphMLWriteContext context)
          Return whether this instance can serialize the EdgeRealizer er in the given context.
 boolean canHandle(Node n, GraphMLParseContext context)
          Return whether this instance can deserialize the content of n in the given context.
 EdgeRealizer createRealizerInstance(Node node, GraphMLParseContext context)
          Create new instance of the Realizer from the given information
 String getName()
          Returns the name of the XML element tag which denotes this type of realizer.
 String getNamespacePrefix()
          Returns the namespace prefix of the toplevel element
 String getNamespaceURI()
          Returns the target namespace of the toplevel element
 Class getRealizerClass()
          Returns the class of which the realizer is an instance of.
 void parse(EdgeRealizer realizer, Node node, GraphMLParseContext context)
          Parses the properties into an instance of EdgeRealizer.
 void write(EdgeRealizer realizer, XmlWriter writer, GraphMLWriteContext context)
          Writes the realizer element's content.
 void writeAttributes(EdgeRealizer realizer, XmlWriter writer, GraphMLWriteContext context)
          Writes the attributes of an EdgeRealizer element.
 

Method Detail

getName

String getName()
Returns the name of the XML element tag which denotes this type of realizer.

Returns:
The name of the XML element

getNamespaceURI

String getNamespaceURI()
Returns the target namespace of the toplevel element

Returns:
the target namespace of the toplevel element

getNamespacePrefix

String getNamespacePrefix()
Returns the namespace prefix of the toplevel element

Returns:
the namespace prefix of the toplevel element

getRealizerClass

Class getRealizerClass()
Returns the class of which the realizer is an instance of.

Returns:
The target class of the realizer

parse

void parse(EdgeRealizer realizer,
           Node node,
           GraphMLParseContext context)
           throws GraphMLParseException
Parses the properties into an instance of EdgeRealizer.

Throws:
GraphMLParseException
Parameters:
realizer - An existing EdgeRealizer instance which is configured.
node - The XML node containing the realizer data.
context - The current parse context.

write

void write(EdgeRealizer realizer,
           XmlWriter writer,
           GraphMLWriteContext context)
           throws GraphMLWriteException
Writes the realizer element's content.

Throws:
GraphMLWriteException
Parameters:
realizer - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.

writeAttributes

void writeAttributes(EdgeRealizer realizer,
                     XmlWriter writer,
                     GraphMLWriteContext context)
Writes the attributes of an EdgeRealizer element.

Parameters:
realizer - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.

canHandle

boolean canHandle(EdgeRealizer er,
                  GraphMLWriteContext context)
Return whether this instance can serialize the EdgeRealizer er in the given context.

Parameters:
er - The realizer to write
context - The current write context.
Returns:
true iff this instance can serialize er in the context of context

canHandle

boolean canHandle(Node n,
                  GraphMLParseContext context)
Return whether this instance can deserialize the content of n in the given context.

Parameters:
n - The DOM node that represents the realizer data.
context - The current parse context.
Returns:
true iff this instance can deserialize n in the context of context

createRealizerInstance

EdgeRealizer createRealizerInstance(Node node,
                                    GraphMLParseContext context)
                                    throws DeserializationNotSupportedException,
                                           GraphMLParseException
Create new instance of the Realizer from the given information

Throws:
DeserializationNotSupportedException
GraphMLParseException
Parameters:
node - The DOM node that represents the realizer data.
context - The current parse context.
Returns:
new instance of the Realizer

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