com.yworks.yfiles.server.graphml.folding
Class PortSerializer

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.folding.PortSerializer
All Implemented Interfaces:
java.util.EventListener, SerializationHandler

public class PortSerializer
extends AbstractSerializer


Constructor Summary
PortSerializer()
           
 
Method Summary
 boolean canHandle(SerializationEvent e)
          Checks whether the current item has the correct type.
 java.lang.String getElementName(GraphMLWriteContext context)
          The local name of the serialized element node.
 java.lang.String getNamespace(GraphMLWriteContext context)
          The namespace 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 writer, GraphMLWriteContext context)
           
 
Methods inherited from class com.yworks.yfiles.server.graphml.flexio.serializer.AbstractSerializer
onHandleSerialization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortSerializer

public PortSerializer()
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:
'Port'

getNamespace

public java.lang.String getNamespace(GraphMLWriteContext context)
The namespace of the serialized element node.

Overrides:
getNamespace in class AbstractSerializer
Parameters:
context - The write context
Returns:
Constants.YFILES_FORMS_NS_URI

serializeItem

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

canHandle

public boolean canHandle(SerializationEvent e)
Checks whether the current item has the correct type. This implementation returns true if the item's class type is Port.class or PortViewState.class.

Parameters:
e - The current event argument
Returns:
The item's class is Port.class or PortViewState.class

getSerializationType

protected java.lang.Class getSerializationType(GraphMLWriteContext context)
Gets the type for which this instance should handle serialization. This method isn't used because the canHandle(y.io.graphml.output.SerializationEvent) method is overridden to be able to serializer Port and PortViewState instances.

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


Copyright © 2000-2013 yWorks GmbH. All rights reserved