Packagecom.yworks.io.graphml.reader
Classpublic class GraphMLParser
ImplementsIContextLookup

A parser that can handle GraphML data.



Public Properties
 PropertyDefined by
  contextLookup : Dictionary
The context dictionary which is used for populating the parse context lookup.
GraphMLParser
  initialContext : GraphMLParseContext
A custom parse context instance that will be used by the parse process.
GraphMLParser
  parseErrorHandler : IGraphMLParseErrorHandler
The error handler for parsing.
GraphMLParser
Public Methods
 MethodDefined by
  
Creates a new instance.
GraphMLParser
  
Adds an input handler to this instance
GraphMLParser
  
Adds a parser for xml attributes.
GraphMLParser
  
lookupForItem(item:Object, type:Class):Object
Tries to create or retrieve an implementation of the given type for a given item.
GraphMLParser
  
parse(graphMLElement:XML):void
Parses a GraphML element
GraphMLParser
  
parseKeyElement(keyElement:XML):void
Parses a XML key element
GraphMLParser
  
Register a default deserializer for XML content.
GraphMLParser
  
Register a deserializer.
GraphMLParser
  
Removes a parser for xml attributes.
GraphMLParser
  
setContextProperty(name:String, value:Object):void
Set a context property which is considered when creating a GraphMLParseContext.
GraphMLParser
  
Sets the factory for graph element creation.
GraphMLParser
Protected Methods
 MethodDefined by
  
Gets the GraphMLParseContext.
GraphMLParser
  
parseDataNodes(dataElements:IMapper, handlerDef:HandlerDefinition):void
Parses the data elements of a graphml element using a suitable handler.
GraphMLParser
  
parseEdgeElement(edgeElement:XML):void
Parses a XML element representing an edge.
GraphMLParser
  
parseGraphElement(graphElement:XML):void
Parses a XML element representing a graph
GraphMLParser
  
parseNodeElement(nodeElement:XML):void
Parses a XML element representing a node.
GraphMLParser
  
parsePortElement(portElement:XML):void
GraphMLParser
Property detail
contextLookupproperty
contextLookup:Dictionary  [read-write]

The context dictionary which is used for populating the parse context lookup.

Implementation
    public function get contextLookup():Dictionary
    public function set contextLookup(value:Dictionary):void
initialContextproperty 
initialContext:GraphMLParseContext  [read-write]

A custom parse context instance that will be used by the parse process.

If this property is not set, a default implementation that is just able to handle the basic graphml deserialization process is used

Implementation
    public function get initialContext():GraphMLParseContext
    public function set initialContext(value:GraphMLParseContext):void
parseErrorHandlerproperty 
parseErrorHandler:IGraphMLParseErrorHandler  [read-write]

The error handler for parsing.

Implementation
    public function get parseErrorHandler():IGraphMLParseErrorHandler
    public function set parseErrorHandler(value:IGraphMLParseErrorHandler):void
Constructor detail
GraphMLParser()constructor
public function GraphMLParser()

Creates a new instance.

Method detail
addInputHandler()method
public function addInputHandler(handler:IInputHandler):void

Adds an input handler to this instance

Parameters
handler:IInputHandler — the input handler to add
addXmlAttributesParser()method 
public function addXmlAttributesParser(attributesParser:IXmlAttributesParser):void

Adds a parser for xml attributes.

Parameters
attributesParser:IXmlAttributesParser — The parser to add.
createParseContext()method 
protected function createParseContext():GraphMLParseContext

Gets the GraphMLParseContext.

Returns
GraphMLParseContext — The GraphMLParseContext.

See also

lookupForItem()method 
public function lookupForItem(item:Object, type:Class):Object

Tries to create or retrieve an implementation of the given type for a given item.

Parameters
item:Object — the item to lookup a type for
 
type:Class — the type to look up

Returns
Object — an implementation or null
parse()method 
public function parse(graphMLElement:XML):void

Parses a GraphML element

Parameters
graphMLElement:XML — The element to parse.
parseDataNodes()method 
protected function parseDataNodes(dataElements:IMapper, handlerDef:HandlerDefinition):void

Parses the data elements of a graphml element using a suitable handler. Called for all registered input handlers.

Parameters
dataElements:IMapper
 
handlerDef:HandlerDefinition
parseEdgeElement()method 
protected function parseEdgeElement(edgeElement:XML):void

Parses a XML element representing an edge.

Parameters
edgeElement:XML — The element to parse.
parseGraphElement()method 
protected function parseGraphElement(graphElement:XML):void

Parses a XML element representing a graph

Parameters
graphElement:XML — The element to parse.
parseKeyElement()method 
public function parseKeyElement(keyElement:XML):void

Parses a XML key element

Parameters
keyElement:XML — The element to parse.
parseNodeElement()method 
protected function parseNodeElement(nodeElement:XML):void

Parses a XML element representing a node.

Parameters
nodeElement:XML — The element to parse.
parsePortElement()method 
protected function parsePortElement(portElement:XML):voidParameters
portElement:XML
registerDefaultDeserializer()method 
public function registerDefaultDeserializer(deserializer:IDeserializer):void

Register a default deserializer for XML content.

A default deserializer will only be used if no more specific deserializer for a given XML fragment exists.

Parameters
deserializer:IDeserializer — A deserializer instance that is to be used for graphml reading
registerDeserializer()method 
public function registerDeserializer(deserializer:IDeserializer):void

Register a deserializer.

Parameters
deserializer:IDeserializer — A deserializer instance that is to be used for graphml reading
removeXmlAttributesParser()method 
public function removeXmlAttributesParser(attributesParser:IXmlAttributesParser):void

Removes a parser for xml attributes.

Parameters
attributesParser:IXmlAttributesParser — The parser to remove.
setContextProperty()method 
public function setContextProperty(name:String, value:Object):void

Set a context property which is considered when creating a GraphMLParseContext.

Parameters
name:String — The name of the property
 
value:Object — the property
setGraphItemFactory()method 
public function setGraphItemFactory(factory:IGraphItemFactory):void

Sets the factory for graph element creation.

Parameters
factory:IGraphItemFactory

See also