| Package | com.yworks.io.graphml.writer.serializer |
| Class | public class PrimitivesSerializer |
| Inheritance | PrimitivesSerializer Object |
| Implements | ISerializer |
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>
| Property | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
canHandle(context:GraphMLWriteContext, subject:Object):Boolean
Return whether this serializer can handle a specific object. | PrimitivesSerializer | ||
| PrimitivesSerializer | |||
| Method | Defined By | ||
|---|---|---|---|
getSymbolicClassNameForClass(classVar:Class):String | PrimitivesSerializer | ||
| elementName | property |
elementName:String [read-only] As the element name for an serialized object depends on it's type.
public function get elementName():String| instance | property |
instance:PrimitivesSerializer [read-only] The shared instance of this serializer.
public static function get instance():PrimitivesSerializer| xmlNamespace | property |
xmlNamespace:Namespace [read-only]
The XmlNamespace that should be used for this serializer which as set in
GraphMLConstants.YWORKS_EXT_PRIMITIVES_NS.
public function get xmlNamespace():NamespaceSee also
| 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
|
Boolean — true 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):StringParameters
classVar:Class |
String |
| serialize | () | method |
public function serialize(context:GraphMLWriteContext, subject:Object, writer:IXmlWriter):voidParameters
context:GraphMLWriteContext | |
subject:Object | |
writer:IXmlWriter |