com.yworks.yfiles.server.graphml.flexio.serializer
Class FlexReflectionBasedSerializer
java.lang.Object
y.io.graphml.output.AbstractSerializer
com.yworks.yfiles.server.graphml.flexio.serializer.ReflectionBasedSerializer
com.yworks.yfiles.server.graphml.flexio.serializer.FlexReflectionBasedSerializer
- All Implemented Interfaces:
- java.util.EventListener, SerializationHandler
- public class FlexReflectionBasedSerializer
- extends ReflectionBasedSerializer
Special reflection based serializer for NodeViewState and EdgeViewState instances.
Takes care of correct capitalization for compatibility with the yFiles FLEX (and yFiles.NET) GraphML format.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FlexReflectionBasedSerializer
public FlexReflectionBasedSerializer()
canHandle
public boolean canHandle(SerializationEvent e)
- Description copied from class:
ReflectionBasedSerializer
- Predicate member method to determine whether this instance should react to a given
SerializationEvent.
Checks if the package of the class of the item in the event is registered in the SymbolicPackageNameRegistry.
- Overrides:
canHandle in class ReflectionBasedSerializer
- Parameters:
e - The event data.
- Returns:
true iff this instance should handle the event.
serializeItem
public void serializeItem(java.lang.Object object,
XmlWriter writer,
GraphMLWriteContext context)
throws GraphMLWriteException
- Description copied from class:
ReflectionBasedSerializer
The namespace for the serialized object consists of the symbolic package name as registered in the
SymbolicPackageNameRegistry for the package of this object's class.
The name of the serialized object maps the name of the object's class.
If there is a ITypeConverter for the object's type registered in TypeConverters which
can convert the object into a String, this String representation is written as text
child node.
Otherwise all public read- and writable properties of the object are added to the xml node.
If an appropriate ITypeConverter can be found via TypeConverters.getTypeConverter
which can convert a property into a String, this property is written as an attributes of the
resulting xml node. Otherwise it is written as a child node of the resulting xml node using an appropriate
looked up serializer.
- Overrides:
serializeItem in class ReflectionBasedSerializer
- Throws:
GraphMLWriteException- See Also:
TypeConverters,
ITypeConverter,
SymbolicPackageNameRegistry
getNamespace
protected java.lang.String getNamespace(GraphMLWriteContext context,
java.lang.Object object)
- Overrides:
getNamespace in class ReflectionBasedSerializer
getTagName
protected java.lang.String getTagName(GraphMLWriteContext context,
java.lang.Object object)
- Overrides:
getTagName in class ReflectionBasedSerializer
getPropertyName
protected java.lang.String getPropertyName(GraphMLWriteContext context,
java.beans.PropertyDescriptor property)
- Description copied from class:
ReflectionBasedSerializer
- Returns the string that should be used for the attribute or child element when a property is serialized.
- Overrides:
getPropertyName in class ReflectionBasedSerializer
- Parameters:
context - The current write contextproperty - A property of the object that is currently being serialized.
- Returns:
- The string that should be used for the attribute or child element
Copyright © 2000-2007 yWorks GmbH. All
rights reserved