Packagecom.yworks.io.graphml.writer.serializer
Classpublic class ExtensionBasedSerializer
InheritanceExtensionBasedSerializer Inheritance ReflectionBasedSerializer Inheritance Object

ISerializer implementation that produces output through the use of a MarkupExtension

The target object is first converted to a MarkupExtension, which then gets serialized with the usual serialization mechanism (usually through ReflectionBasedSerializer.

To declare a type as serializable with a markup extension, use the GraphMLSerializer and TypeConverter meta tags: [GraphMLSerializer(type="com.yworks.io.graphml.writer.serializer.ExtensionBasedSerializer")] [TypeConverter(type='com.yworks.io.graphml.markup.MyConverter')] public class MyClass { .. } Note that MyConverter must be able to convert MyClass to a MarkupExtension.



Public Properties
 PropertyDefined By
 InheritedelementName : String
[read-only] The element name of the toplevel XmlElement for the serialized representation of this object.
ReflectionBasedSerializer
  instance : ExtensionBasedSerializer
[static] [read-only] The shared instance of this serializer.
ExtensionBasedSerializer
 InheritedxmlNamespace : Namespace
[read-only]
ReflectionBasedSerializer
Public Methods
 MethodDefined By
  
ExtensionBasedSerializer
  
canHandle(context:GraphMLWriteContext, object:Object):Boolean
[override] Returns true iff the provided object can be converted to a MarkupExtension.
ExtensionBasedSerializer
  
serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
[override]
ExtensionBasedSerializer
Protected Methods
 MethodDefined By
 Inherited
getMemberSerializer(context:GraphMLWriteContext, subject:Object, currentValue:Object, propertyDesc:XML):ISerializer
ReflectionBasedSerializer
 Inherited
getProperties(context:GraphMLWriteContext, subject:Object):XMLList
Returns a list of all properties that should be serialized.
ReflectionBasedSerializer
  
getTagName(context:GraphMLWriteContext, subject:Object):String
[override] Returns the XML extension name, i.e.
ExtensionBasedSerializer
 Inherited
getXmlNamespace(context:GraphMLWriteContext, subject:Object):Namespace
ReflectionBasedSerializer
 Inherited
hasDefaultValue(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Returns true if a property has a default value and therefore should not be written at all.
ReflectionBasedSerializer
 Inherited
isCollectionProperty(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Returns true if the property is a collection property that needs to be handled specially.
ReflectionBasedSerializer
 Inherited
serializeContent(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
Write the content of the graphml element that corresponds to the serialization of subject.
ReflectionBasedSerializer
 Inherited
shouldSerialize(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Returns true if property should be serialized.
ReflectionBasedSerializer
 Inherited
shouldWriteMemberAsAttribute(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Determines whether property should be written as attribute value or as complete element.
ReflectionBasedSerializer
Property Detail
instanceproperty
instance:ExtensionBasedSerializer  [read-only]

The shared instance of this serializer.


Implementation
    public static function get instance():ExtensionBasedSerializer
Constructor Detail
ExtensionBasedSerializer()Constructor
public function ExtensionBasedSerializer()



Method Detail
canHandle()method
override public function canHandle(context:GraphMLWriteContext, object:Object):Boolean

Returns true iff the provided object can be converted to a MarkupExtension.

Parameters

context:GraphMLWriteContext — The current write context.
 
object:Object — The object that should be serialized.

Returns
Booleantrue iff the provided object can be converted to a MarkupExtension.

See also

getTagName()method 
override protected function getTagName(context:GraphMLWriteContext, subject:Object):String

Returns the XML extension name, i.e. without an "Extension" suffix.

Parameters

context:GraphMLWriteContext — The current write context.
 
subject:Object — The object that should be serialized.

Returns
String — The XML extension name, i.e. without an "Extension" suffix.
serialize()method 
override public function serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void

Parameters

context:GraphMLWriteContext
 
subject:Object
 
writer:IXmlWriter