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

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

public abstract class DelegatingStyleSerializer
extends AbstractSerializer

An abstract serializer which facilitates the creation of serializers for DelegatingStyle instances.

Subclasses have to override AbstractSerializer.getElementName(y.io.graphml.output.GraphMLWriteContext) and TypeBasedSerializer.getSerializationType(y.io.graphml.output.GraphMLWriteContext).
The method serializeItem(Object, y.io.graphml.output.XmlWriter, y.io.graphml.output.GraphMLWriteContext)) should not be overridden. Instead the style's properties should be serialized in serializeStyle(y.io.graphml.output.GraphMLWriteContext, Object, y.io.graphml.output.XmlWriter).


Constructor Summary
DelegatingStyleSerializer()
           
 
Method Summary
 void serializeItem(java.lang.Object item, XmlWriter writer, GraphMLWriteContext context)
           
 void serializeStyle(GraphMLWriteContext context, java.lang.Object subject, XmlWriter writer)
          Serializes the style properties.
 
Methods inherited from class com.yworks.yfiles.server.graphml.flexio.serializer.AbstractSerializer
getElementName, getNamespace, onHandleSerialization
 
Methods inherited from class y.io.graphml.output.TypeBasedSerializer
canHandle, getSerializationType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingStyleSerializer

public DelegatingStyleSerializer()
Method Detail

serializeItem

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

serializeStyle

public void serializeStyle(GraphMLWriteContext context,
                           java.lang.Object subject,
                           XmlWriter writer)
Serializes the style properties.

The wrapped style is already serialized by serializeItem(Object, y.io.graphml.output.XmlWriter, y.io.graphml.output.GraphMLWriteContext). For styles which do not have own properties, this method does not have to be overridden.

Parameters:
context - The write context.
subject - The delegating style.
writer - The writer to serialize the style with.


Copyright © 2000-2013 yWorks GmbH. All rights reserved