Package | com.yworks.io.graphml.realizer |
Class | public class JavaGenericNodeRealizerSerializer |
Inheritance | JavaGenericNodeRealizerSerializer AbstractJavaNodeRealizerSerializer Object |
GenericNodeRealizer
s (yFiles Java) /
JavaGenericNodeStyle
s (yFiles Flex).
As GenericNodeRealizer
s are serialized only with their configuration name,
this deserializer searches for the configuration names in its configuration map
for appropriate styles. Thus, when initializing this serializer/deserializer, appropriate
styles have to be mapped to their corresponding styles.
The configuration
property will be set automatically to the serialized
configuration name for styles which are deserialized from GraphML.
Styles which are created on the client must have their configuration
property
set to a valid configuration name in order to get serialized properly. If that
configuration is not in the serializer's configuration map, it will be stored there
automatically if such a style is serialized.
See also
Property | Defined By | ||
---|---|---|---|
fallback : INodeStyle
A style which is used when the configuration is not in the map. | JavaGenericNodeRealizerSerializer | ||
instance : JavaGenericNodeRealizerSerializer [static] [read-only]
The singleton instance of this serializer/deserializer. | JavaGenericNodeRealizerSerializer |
Method | Defined By | ||
---|---|---|---|
addConfiguration(name:String, style:INodeStyle):void
Adds a new configuration to the configuration map. | JavaGenericNodeRealizerSerializer | ||
canRead(node:XML, context:GraphMLParseContext):Boolean [override]
Returns true if the given element can be handled by this serializer. | JavaGenericNodeRealizerSerializer | ||
[override]
Whether this serializer can handle the style of the given node. | JavaGenericNodeRealizerSerializer | ||
[override]
Creates a new instance of the style which is represented by the given element. | JavaGenericNodeRealizerSerializer | ||
getElementName(item:Object):String [override]
Returns the name of the element that will be written by this serializer given the provided item. | JavaGenericNodeRealizerSerializer | ||
getElementNames():Array [override]
Returns the names of all XML elements that can be parsed or written by this serializer. | JavaGenericNodeRealizerSerializer | ||
getNamespace():Namespace
Returns the namespace of the element this serilaizer writes. | AbstractJavaNodeRealizerSerializer | ||
getStyleClass():Class
Returns the style class that can be serialized or deserialized by this instance. | AbstractJavaNodeRealizerSerializer | ||
Parses a serialized yFiles Java node realizer into the given style. | AbstractJavaNodeRealizerSerializer | ||
removeConfiguration(name:String):void
Removes the configuration with the given name from the configuration map. | JavaGenericNodeRealizerSerializer | ||
[override]
Writes the given node's style. | JavaGenericNodeRealizerSerializer | ||
Write the attributes of the realizer xml element
| AbstractJavaNodeRealizerSerializer |
fallback | property |
fallback:INodeStyle
A style which is used when the configuration is not in the map.
May be null
if no fallback should be used.
If the style does not extend JavaGenericNodeStyle
it will
be wrapped in a JavaGenericNodeStyleWrapper
.
The default value is null
.
public function get fallback():INodeStyle
public function set fallback(value:INodeStyle):void
instance | property |
instance:JavaGenericNodeRealizerSerializer
[read-only] The singleton instance of this serializer/deserializer.
public static function get instance():JavaGenericNodeRealizerSerializer
addConfiguration | () | method |
public function addConfiguration(name:String, style:INodeStyle):void
Adds a new configuration to the configuration map.
Parameters
name:String — The name of the configuration as it is serialized with. If the name
already exists in the map, the existing configuration will be replaced.
| |
style:INodeStyle — The style which is used for realizers with the given configuration
name. If the style does not extend JavaGenericNodeStyle it will
be wrapped in a JavaGenericNodeStyleWrapper .
|
canRead | () | method |
override public function canRead(node:XML, context:GraphMLParseContext):Boolean
Returns true if the given element can be handled by this serializer.
This is the case if the element name is "GenericNode", and the
configuration is mapped in the configuration map or the fallback is not null
.
Parameters
node:XML — The XML element to parse.
| |
context:GraphMLParseContext — The parse context.
|
Boolean — true if the given element can be parsed.
|
canWrite | () | method |
override public function canWrite(node:INode, context:GraphMLWriteContext):Boolean
Whether this serializer can handle the style of the given node.
This is the case if the given node's style is of type
JavaGenericNodeStyle
Parameters
node:INode — The node whose style is to be serialized.
| |
context:GraphMLWriteContext — The write context.
|
Boolean — true if the given node's style can be serialized.
|
createStyleInstance | () | method |
override public function createStyleInstance(element:XML, context:GraphMLParseContext):INodeStyle
Creates a new instance of the style which is represented by the given element.
Parameters
element:XML — The element to parsed.
| |
context:GraphMLParseContext — The parse context.
|
INodeStyle — A new instance of the style or the fallback style.
|
getElementName | () | method |
override public function getElementName(item:Object):String
Returns the name of the element that will be written by this serializer given the provided item.
Parameters
item:Object |
String — the name of the item
|
getElementNames | () | method |
override public function getElementNames():Array
Returns the names of all XML elements that can be parsed or written by this serializer.
ReturnsArray — The names of all xml elements this serializer can handle as Array .
|
removeConfiguration | () | method |
public function removeConfiguration(name:String):void
Removes the configuration with the given name from the configuration map.
Parameters
name:String — The name of the configuration to remove.
|
write | () | method |
override public function write(node:INode, writer:IXmlWriter, context:GraphMLWriteContext):void
Writes the given node's style.
Parameters
node:INode — The node whose style should be written.
| |
writer:IXmlWriter — The XML writer to write to.
| |
context:GraphMLWriteContext — The write context.
|