Packagecom.yworks.io.graphml.writer.serializer
Classpublic class DelegatingStyleSerializer
InheritanceDelegatingStyleSerializer Inheritance AbstractSerializer Inheritance Object
Subclasses FilterNodeStyleSerializer

An abstract serializer which faciliates the creation of serializers for IDelegatingStyle instances.

Subclasses have to override the elementName and type properties and the serializeStyle method.



Public Properties
 PropertyDefined By
 InheritedelementName : String
[read-only] The element name of the toplevel XmlElement for the serialized representation of this object.
AbstractSerializer
 InheritedxmlNamespace : Namespace
[read-only] returns the yworks namespace
AbstractSerializer
Protected Properties
 PropertyDefined By
  type : Class
[read-only] The type which this serializer claims to handle.
DelegatingStyleSerializer
Public Methods
 MethodDefined By
  
canHandle(context:GraphMLWriteContext, subject:Object):Boolean
[override] This implementation returns true if the subject is of the type which is returned by the type property and is not null Return whether this serializer can handle a specific object.
DelegatingStyleSerializer
 Inherited
serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
Serialize the given style to a IXmlWriter.
AbstractSerializer
Protected Methods
 MethodDefined By
  
serializeContent(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
[override] This implementation serializes the wrapped style into a <y:Wrapped> element and calls serializeStyle().
DelegatingStyleSerializer
  
serializeStyle(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
Serializes the properties of the style.
DelegatingStyleSerializer
Property Detail
typeproperty
type:Class  [read-only]

The type which this serializer claims to handle.

Subclasses have to override this property.


Implementation
    protected function get type():Class
Method Detail
canHandle()method
override public function canHandle(context:GraphMLWriteContext, subject:Object):Boolean

This implementation returns true if the subject is of the type which is returned by the type property and is not null Return whether this serializer can handle a specific object.

Parameters

context:GraphMLWriteContext — The write context.
 
subject:Object — The object which is tested

Returns
Booleantrue if the serializer can handle the subject
serializeContent()method 
override protected function serializeContent(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void

This implementation serializes the wrapped style into a <y:Wrapped> element and calls serializeStyle(). Write the content of the graphml element that corresponds to the serialization of subject.

Parameters

context:GraphMLWriteContext — The current write context.
 
subject:Object — The current object to be serialized.
 
writer:IXmlWriter — The xml writer.

serializeStyle()method 
protected function serializeStyle(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void

Serializes the properties of the style.

When this method is called, the element of the style is the current element.

This implementation does nothing. If the style to serialize has no own properties to serialize, it is not necessary to override this method.

Parameters

context:GraphMLWriteContext — The write context.
 
subject:Object — The style to serialize.
 
writer:IXmlWriter — The writer to write to.