Packagecom.yworks.io.graphml.writer.serializer
Classpublic class PrimitivesSerializer
InheritancePrimitivesSerializer Inheritance Object
Implements ISerializer

This serializer serializes uint, int, Number, String and Boolean values.

The XML node name used for such an object depends on the String value returned by getQualifiedClassName(object). While the node names for String and Boolean values match those of their classes, the node name for Number is changed to 'Double' and the name for int is changed to Integer to match the equivalent server side data type.

The following XML nodes show examples of serialized primitive objects: <ysys:String>Number 42</ysys:String> <ysys:Boolean>true</ysys:Boolean> <ysys:Double>4.2</ysys:Double> <ysys:Integer>-42</ysys:Integer> <ysys:Double>2147483648</ysys:Double>



Public Properties
 PropertyDefined By
  elementName : String
[read-only] As the element name for an serialized object depends on it's type.
PrimitivesSerializer
  instance : PrimitivesSerializer
[static] [read-only] The shared instance of this serializer.
PrimitivesSerializer
  xmlNamespace : Namespace
[read-only] The XmlNamespace that should be used for this serializer which as set in GraphMLConstants.YWORKS_EXT_PRIMITIVES_NS.
PrimitivesSerializer
Public Methods
 MethodDefined By
  
canHandle(context:GraphMLWriteContext, subject:Object):Boolean
Return whether this serializer can handle a specific object.
PrimitivesSerializer
  
serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void
PrimitivesSerializer
Protected Methods
 MethodDefined By
  
getSymbolicClassNameForClass(classVar:Class):String
PrimitivesSerializer
Property Detail
elementNameproperty
elementName:String  [read-only]

As the element name for an serialized object depends on it's type.


Implementation
    public function get elementName():String
instanceproperty 
instance:PrimitivesSerializer  [read-only]

The shared instance of this serializer.


Implementation
    public static function get instance():PrimitivesSerializer
xmlNamespaceproperty 
xmlNamespace:Namespace  [read-only]

The XmlNamespace that should be used for this serializer which as set in GraphMLConstants.YWORKS_EXT_PRIMITIVES_NS.


Implementation
    public function get xmlNamespace():Namespace

See also

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

Return whether this serializer can handle a specific object. This is the case if this object is of type uint, int, Number, Boolean or String and if an ITypeConverter is registered for this type that allows converting the object into a String representation.

Parameters

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

Returns
Booleantrue if this object is of type uint, int, Number, Boolean or String and if an ITypeConverter is registered for this type that allows converting the object into a String representation.

See also

getSymbolicClassNameForClass()method 
protected function getSymbolicClassNameForClass(classVar:Class):String

Parameters

classVar:Class

Returns
String
serialize()method 
public function serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):void

Parameters

context:GraphMLWriteContext
 
subject:Object
 
writer:IXmlWriter