yext.svg.io
Class SVGIconSerializer

java.lang.Object
  extended by yext.svg.io.SVGIconSerializer
All Implemented Interfaces:
EventListener, DeserializationHandler, SerializationHandler

public class SVGIconSerializer
extends Object
implements SerializationHandler, DeserializationHandler

Provides GraphML (de-)serialization support for SVGIcon instances.

 

Constructor Summary
SVGIconSerializer()
           
 
Method Summary
protected  SVGIcon deserializeNode(Node node, GraphMLParseContext context)
          Deserializes a SVGIcon instance from a <y:SVGIcon> element.
 void onHandleDeserialization(DeserializationEvent event)
          Deserializes SVGIcon instances from <y:SVGIcon> elements.
 void onHandleSerialization(SerializationEvent event)
          Serializes SVGIcon instances to <y:SVGIcon> elements.
protected  void serializeItem(SVGIcon item, XmlWriter writer, GraphMLWriteContext context)
          Serializes the specified SVGIcon instance to a <y:SVGIcon> element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGIconSerializer

public SVGIconSerializer()
Method Detail

onHandleDeserialization

public void onHandleDeserialization(DeserializationEvent event)
                             throws GraphMLParseException
Deserializes SVGIcon instances from <y:SVGIcon> elements. Calls deserializeNode(org.w3c.dom.Node, y.io.graphml.input.GraphMLParseContext).

Specified by:
onHandleDeserialization in interface DeserializationHandler
Parameters:
event - Event that contains all data that is needed for deserialization.
Throws:
GraphMLParseException - if something went wrong in the serialization process.

deserializeNode

protected SVGIcon deserializeNode(Node node,
                                  GraphMLParseContext context)
                           throws GraphMLParseException
Deserializes a SVGIcon instance from a <y:SVGIcon> element. Called from onHandleDeserialization(y.io.graphml.input.DeserializationEvent).

Parameters:
node - the XML node to parse.
context - the current parse context.
Returns:
the deserialized value of the given XML node.
Throws:
GraphMLParseException - if something went wrong in the serialization process.

onHandleSerialization

public void onHandleSerialization(SerializationEvent event)
                           throws GraphMLWriteException
Serializes SVGIcon instances to <y:SVGIcon> elements. Calls serializeItem(yext.svg.view.SVGIcon, y.io.graphml.output.XmlWriter, y.io.graphml.output.GraphMLWriteContext).

Specified by:
onHandleSerialization in interface SerializationHandler
Parameters:
event - Event that contains all data that is needed for serialization.
Throws:
GraphMLWriteException - if something went wrong in the serialization process.

serializeItem

protected void serializeItem(SVGIcon item,
                             XmlWriter writer,
                             GraphMLWriteContext context)
                      throws GraphMLWriteException
Serializes the specified SVGIcon instance to a <y:SVGIcon> element.

Parameters:
item - the icon to serialize.
writer - the writer for the serialized output.
context - the current write context.
Throws:
GraphMLWriteException - if something went wrong in the serialization process.


© Copyright 2002-2015,
yWorks GmbH.
All rights reserved.