Package | com.yworks.io.graphml.writer.serializer |
Class | public class ExtensionBasedSerializer |
Inheritance | ExtensionBasedSerializer ReflectionBasedSerializer 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
.
Property | Defined By | ||
---|---|---|---|
elementName : 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 | ||
xmlNamespace : Namespace [read-only]
| ReflectionBasedSerializer |
Method | Defined By | ||
---|---|---|---|
ExtensionBasedSerializer | |||
canHandle(context:GraphMLWriteContext, object:Object):Boolean [override]
Returns true iff the provided object can be converted to a MarkupExtension. | ExtensionBasedSerializer | ||
[override] | ExtensionBasedSerializer |
Method | Defined By | ||
---|---|---|---|
getMemberSerializer(context:GraphMLWriteContext, subject:Object, currentValue:Object, propertyDesc:XML):ISerializer | ReflectionBasedSerializer | ||
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 | ||
getXmlNamespace(context:GraphMLWriteContext, subject:Object):Namespace | ReflectionBasedSerializer | ||
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 | ||
isCollectionProperty(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Returns true if the property is a collection property that needs to be handled specially. | ReflectionBasedSerializer | ||
Write the content of the graphml element that corresponds to the serialization of subject. | ReflectionBasedSerializer | ||
shouldSerialize(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Returns true if property should be serialized. | ReflectionBasedSerializer | ||
shouldWriteMemberAsAttribute(context:GraphMLWriteContext, subject:Object, property:XML):Boolean
Determines whether property should be written as attribute value or as complete
element. | ReflectionBasedSerializer |
instance | property |
instance:ExtensionBasedSerializer
[read-only] The shared instance of this serializer.
public static function get instance():ExtensionBasedSerializer
ExtensionBasedSerializer | () | Constructor |
public function ExtensionBasedSerializer()
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.
|
Boolean — true 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.
|
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 |