com.yworks.yfiles.server.graphml.flexio.serializer
Class ImageSerializer

java.lang.Object
  extended byy.io.graphml.output.AbstractSerializer
      extended byy.io.graphml.output.TypeBasedSerializer
          extended bycom.yworks.yfiles.server.graphml.flexio.serializer.AbstractSerializer
              extended bycom.yworks.yfiles.server.graphml.flexio.serializer.ImageSerializer
All Implemented Interfaces:
java.util.EventListener, SerializationHandler

public class ImageSerializer
extends AbstractSerializer

Serializer for Image writing the image as byte stream.


Constructor Summary
ImageSerializer()
           
 
Method Summary
 boolean canHandle(SerializationEvent e)
          Checks whether the current item is an instance of java.awt.Image
 java.lang.String getElementName(GraphMLWriteContext context)
          The local name of the serialized element node.
protected  java.lang.Class getSerializationType(GraphMLWriteContext context)
          Gets the type for which this instance should handle serialization.
 void serializeItem(java.lang.Object item, XmlWriter xmlWriter, GraphMLWriteContext context)
           
 
Methods inherited from class com.yworks.yfiles.server.graphml.flexio.serializer.AbstractSerializer
getNamespace, onHandleSerialization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageSerializer

public ImageSerializer()
Method Detail

getElementName

public java.lang.String getElementName(GraphMLWriteContext context)
The local name of the serialized element node.

Specified by:
getElementName in class AbstractSerializer
Parameters:
context - The write context.
Returns:
'Image'

serializeItem

public void serializeItem(java.lang.Object item,
                          XmlWriter xmlWriter,
                          GraphMLWriteContext context)
                   throws GraphMLWriteException
Throws:
GraphMLWriteException

canHandle

public boolean canHandle(SerializationEvent e)
Checks whether the current item is an instance of java.awt.Image

Parameters:
e - The current event argument.
Returns:
true, if the item of the event is an instance of java.awt.Image.

getSerializationType

protected java.lang.Class getSerializationType(GraphMLWriteContext context)
Gets the type for which this instance should handle serialization. As canHandle is overridden this method isn't used.

Parameters:
context - The current write context.
Returns:
Image.class


Copyright © 2000-2013 yWorks GmbH. All rights reserved