| Package | com.yworks.io.graphml.reader |
| Class | public class ObjectMapperAttributeInputHandler |
| Inheritance | ObjectMapperAttributeInputHandler AbstractInputHandler Object |
IDeserializer instance.
| Property | Defined By | ||
|---|---|---|---|
| autoCreateMapper : Boolean [read-only]
Describes if a mapper shall be added to the graph's mapper registry using the tag passed to the
constructor if no such mapper is in the registry, yet. | ObjectMapperAttributeInputHandler | ||
| Method | Defined By | ||
|---|---|---|---|
ObjectMapperAttributeInputHandler(scopeType:String, tag:Object, deserializer:IDeserializer = null, autoCreateMapper:Boolean = false)
Create a new instance that will parse complex mapper data using the provided deserializer and
store the resulting objects in a mapper that is retrieved from the graph using the provided
mapper tag. | ObjectMapperAttributeInputHandler | ||
acceptKey(keyElement:XML, scopeType:String):Boolean [override]
This method defines whether a specific key/data pair is
handled by the input handler. | ObjectMapperAttributeInputHandler | ||
![]() | applyDefault(context:GraphMLParseContext, defaultElement:XML, value:Object):void
This method is invoked when no data tag is defined, and the default value
should be applied. | AbstractInputHandler | |
![]() | getAttributeName(keyElement:XML):String [static]
Returns the value of the first attribute with the name GraphMLConstants.ATTR_NAME. | AbstractInputHandler | |
![]() | getAttributeType(keyElement:XML):String [static]
Returns the value of the first attribute with the name GraphMLConstants.ATTR_TYPE. | AbstractInputHandler | |
initialize(context:GraphMLParseContext):void
Initializes this input handler. | ObjectMapperAttributeInputHandler | ||
![]() | parseData(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):void
Forwards to parseItemData
This method is invoked each time a data element with matching key
is processed. | AbstractInputHandler | |
parseDefaultData(context:GraphMLParseContext, keyElement:XML):Object [override]
This method is invoked when the default value of the key element
for a data element is parsed. | ObjectMapperAttributeInputHandler | ||
| Method | Defined By | ||
|---|---|---|---|
Called if the mapper instance is not found in the graph's mapperRegistry and
autoCreateMapper is true. | ObjectMapperAttributeInputHandler | ||
getAttributeName():String
Returns the name that will be used for the GraphML attribute. | ObjectMapperAttributeInputHandler | ||
Returns the IMapper which is handled by this instance. | ObjectMapperAttributeInputHandler | ||
parseItemData(context:GraphMLParseContext, graph:IGraph, item:Object, defaultMode:Boolean, element:XML):void [override]
Parse the element for the given item. | ObjectMapperAttributeInputHandler | ||
| autoCreateMapper | property |
autoCreateMapper:Boolean [read-only]
Describes if a mapper shall be added to the graph's mapper registry using the tag passed to the
constructor if no such mapper is in the registry, yet.
public function get autoCreateMapper():Boolean| ObjectMapperAttributeInputHandler | () | Constructor |
public function ObjectMapperAttributeInputHandler(scopeType:String, tag:Object, deserializer:IDeserializer = null, autoCreateMapper:Boolean = false)Create a new instance that will parse complex mapper data using the provided deserializer and store the resulting objects in a mapper that is retrieved from the graph using the provided mapper tag.
ParametersscopeType:String — The scope type of the attribute. One of
| |
tag:Object — The tag that will be used to retrieve the mapper instance from the graph's mapperRegistry
| |
deserializer:IDeserializer (default = null) — The deserializer instance that will be used for parsing the complex data objects.
| |
autoCreateMapper:Boolean (default = false) |
| acceptKey | () | method |
override public function acceptKey(keyElement:XML, scopeType:String):Boolean
This method defines whether a specific key/data pair is
handled by the input handler.
When it returns true, each occurence of
data elements which match the id of the key element are
forwarded to the input handler.
Parameters
keyElement:XML — the key element
| |
scopeType:String — the scope type for which the key is defined.
One of
|
Boolean — true, if this hanlder can handle the data elements asked for.
|
| createMapper | () | method |
protected function createMapper():IMapper
Called if the mapper instance is not found in the graph's mapperRegistry and
autoCreateMapper is true.
IMapper |
| getAttributeName | () | method |
protected function getAttributeName():StringReturns the name that will be used for the GraphML attribute.
The default implementation just converts the tag that was passed to the constructor to a String.
ReturnsString |
| getMapper | () | method |
protected function getMapper(graph:IGraph):IMapper
Returns the IMapper which is handled by this instance.
This implementation tries to retrieve the mapper from the given graph.
If no mapper is registered yet and this instance is created with
autoCreateMapper set to true a new mapper will be created
by createMapper and registered at the graph's mapper registry.
Parameters
graph:IGraph — The graph to get the mapper from.
|
IMapper — The mapper which is handled by this instance.
|
| initialize | () | method |
public function initialize(context:GraphMLParseContext):void
Initializes this input handler.
This method is called by AutoMapperInputHandlerProvider.
Parameters
context:GraphMLParseContext — The current parse context.
|
| parseDefaultData | () | method |
override public function parseDefaultData(context:GraphMLParseContext, keyElement:XML):ObjectThis method is invoked when the default value of the key element for a data element is parsed.
Parameters
context:GraphMLParseContext — the current parse context.
| |
keyElement:XML — the xml node representing the key element.
|
Object — null
|
| parseItemData | () | method |
override protected function parseItemData(context:GraphMLParseContext, graph:IGraph, item:Object, defaultMode:Boolean, element:XML):voidParse the element for the given item. This method has to be overridden by subclass implementations.
Parameters
context:GraphMLParseContext — The current parse context
| |
graph:IGraph — The current graph
| |
item:Object — The current edge
| |
defaultMode:Boolean — Whether to parse default data
| |
element:XML — The current xml data element
|