Packagecom.yworks.io.graphml
Classpublic class GraphMLIOHandler
InheritanceGraphMLIOHandler Inheritance flash.events.EventDispatcher
Implements IOHandler
Subclasses DefaultGraphMLIOHandler, DotnetCompatGraphMLIOHandler, JavaCompatGraphMLIOHandler, LayoutGraphMLIOHandler

An IOHandler that can read and write graphs in graphml format.

Note that no additional input/output handlers are registered if an instances of this class is created, i.e. no graphical properties of graph items will be read or written by a "plain" instance that was not configured by adding IInputHandlers, IOuputHandlers, IDeserialiers and/or IRealizerSerializers.

Usually, a preconfigured GraphMLIOHandler class should be used instead of this class. Most yFiles FLEX applications can just use a com.yworks.remote.RoundtripHandler instance to read and write GraphML data. RoundtripHandler will use preconfigured io handlers for reading and writing. As an alternative, DotnetCompatGraphMLIOHandler or JavaCompatGraphmlIOHandler can be used.

See the graphml primer at graphdrawing.org

See also

com.yworks.remote.RoundtripHandler
com.yworks.io.JavaCompatGraphmlIOHandler
com.yworks.io.DotnetCompatGraphMLIOHandler


Public Properties
 PropertyDefined By
  adjustFontSize : Boolean
Whether to adjust the font size when serializing / deserializing fonts.
GraphMLIOHandler
  clearGraphBeforeRead : Boolean
Whether to clear an existing graph instance before reading.
GraphMLIOHandler
  fontSizeFactor : Number
The factor to adjust the font size when serializing / deserializing fonts.
GraphMLIOHandler
  inputHandlerProvider : IInputHandlerProvider
Gets or sets an IInputHandlerProvider instance for dynamic input handler retrieval.
GraphMLIOHandler
  localViewMode : Boolean
Whether to read/write only the local view for folded graphs.
GraphMLIOHandler
  outputHandlerProvider : IOutputHandlerProvider
Gets or sets an IOutputHandlerProvider instance for dynamic output handler retrieval.
GraphMLIOHandler
  parseErrorHandler : IGraphMLParseErrorHandler
An error handler that will be used to handle errors which occur during parsing.
GraphMLIOHandler
  readLabels : Boolean
Whether labels should be deserialized.
GraphMLIOHandler
  readMajorVersion : int
The major file format version for the input.
GraphMLIOHandler
  readMinorVersion : int
The minor file format version for the input.
GraphMLIOHandler
  readPortLocationModel : Boolean
Whether port location models should be deserialized.
GraphMLIOHandler
  readRealizers : Boolean
Whether styles should be deserialized from realizers.
GraphMLIOHandler
  readStyles : Boolean
Whether styles should be deserialized.
GraphMLIOHandler
  readTables : Boolean
Whether to read tables.
GraphMLIOHandler
  realizerSerializerManager : RealizerSerializerManager
[read-only] Get the RealizerSerializerManager instance used by this GraphMLIOHandler.
GraphMLIOHandler
  supportUserTags : Boolean
Whether to support user tags at ModelItems automatically.
GraphMLIOHandler
  supportZOrder : Boolean
Whether to support z-orders of IModelItems automatically.
GraphMLIOHandler
  writeLabels : Boolean
Whether labels should be serialized.
GraphMLIOHandler
  writeMajorVersion : int
The major file format version for the output
GraphMLIOHandler
  writeMinorVersion : int
The minor file format version for the output
GraphMLIOHandler
  writePortLocationModel : Boolean
Whether port location models should be serialized.
GraphMLIOHandler
  writeRealizers : Boolean
Whether styles should be serialized as realizers.
GraphMLIOHandler
  writeSharedReferences : Boolean
Whether to support object sharing on output.
GraphMLIOHandler
  writeStyles : Boolean
Whether styles should be serialized.
GraphMLIOHandler
  writeTables : Boolean
Whether to write tables.
GraphMLIOHandler
Protected Properties
 PropertyDefined By
  _edgeOutputHandlers : List
The installed edge output handlers
GraphMLIOHandler
  _graphMLOutputHandlers : List
The installed graphml output handlers
GraphMLIOHandler
  _graphOutputHandlers : List
The installed graph output handlers
GraphMLIOHandler
  _inputHandlers : List
The installed input handlers
GraphMLIOHandler
  _namespaces : ArrayList
The installed namespaces
GraphMLIOHandler
  _nodeOutputHandlers : List
The installed node output handlers
GraphMLIOHandler
  _portOutputHandlers : List
The installed port output handlers
GraphMLIOHandler
Public Methods
 MethodDefined By
  
Constructor.
GraphMLIOHandler
  
addEdgeAttribute(mapper:IMapper, attrName:String, type:String = string):void
Adds a GraphML attribute with edge scope that holds data of simple type.
GraphMLIOHandler
  
addGraphAttribute(mapper:IMapper, attrName:String, type:String = string):void
Adds a GraphML attribute with graph scope that holds data of simple type.
GraphMLIOHandler
  
Adds a input handler that can parse <data> blocks.
GraphMLIOHandler
  
addNamespace(ns:Namespace):void
Adds a namespace to the header of a GraphML file.
GraphMLIOHandler
  
addNodeAttribute(mapper:IMapper, attrName:String, type:String = string):void
Adds a GraphML attribute with node scope that holds data of simple type.
GraphMLIOHandler
  
addOutputHandler(outputHandler:IOutputHandler, scope:String):void
Adds a subordinate output handler for the given element scope to this GraphMLIOHandler.
GraphMLIOHandler
  
addRegistryEdgeAttribute(registryTag:Object, attrName:String, type:String = string):void
Adds a GraphML attribute with edge scope that holds data of simple type.
GraphMLIOHandler
  
addRegistryGraphAttribute(registryTag:Object, attrName:String, type:String = string):void
Adds a GraphML attribute with graph scope that holds data of simple type.
GraphMLIOHandler
  
addRegistryNodeAttribute(registryTag:Object, attrName:String, type:String = string):void
Adds a GraphML attribute with node scope that holds data of simple type.
GraphMLIOHandler
  
Returns an iterable view of all input handlers that have been registered with this instance.
GraphMLIOHandler
  
Returns an editable view on the registered output handlers for GraphML attributes with given scope that are registered with this GraphMLIOHandler.
GraphMLIOHandler
  
Returns an Iterable of all deserializers that have been registered with this instance.
GraphMLIOHandler
  
Returns an iterable view of all serializers that have been registered with this instance.
GraphMLIOHandler
  
read(graph:IGraph, xml:XML):void
populate the given graph with the graph defined in the given xml file.
GraphMLIOHandler
  
readURL(graph:IGraph, url:String):void
Populate the graph with the graph structure defined in a graph file located at the URL.
GraphMLIOHandler
  
Register a IDeserializer instance for reading custom information.
GraphMLIOHandler
  
Register a ISerializer instance for writing custom information.
GraphMLIOHandler
  
Removes an input handler.
GraphMLIOHandler
  
removeOutputHandler(outputHandler:IOutputHandler, scope:String):void
Removes an output handler that was added for the given scope.
GraphMLIOHandler
  
Unregister an IDeserializer instance that was previously registered.
GraphMLIOHandler
  
Unregister an ISerializer instance that was previously registered.
GraphMLIOHandler
  
write(graph:IGraph):XML
Write the given graph to a XML Object in GraphML format.
GraphMLIOHandler
Protected Methods
 MethodDefined By
  
Sets up all default IDeserializer instances on context.
GraphMLIOHandler
  
Sets up all input handlers for the provided parser instance.
GraphMLIOHandler
  
Configures context to use all registered serializers.
GraphMLIOHandler
  
Create the DirectGraphMLWriter instance that is used for writing GraphML output.
GraphMLIOHandler
  
Create a suitable instance of IGraphElementFactory that can handle the given graph
GraphMLIOHandler
  
Create an IGraphElementProvider instance that provides the graph elements that are to be written.
GraphMLIOHandler
  
Create the GraphMLParser instance that is used for writing GraphML output.
GraphMLIOHandler
  
Callback method for the creation of a new read context.
GraphMLIOHandler
  
Callback method for the creation of a new write context.
GraphMLIOHandler
  
Create the IXmlWriter instance that is used for low-level XML writing.
GraphMLIOHandler
  
Callback for subclasses to register default data handlers.
GraphMLIOHandler
Events
 Event Summary Defined By
  Dispatched when the io handler has finished parsing a graph.GraphMLIOHandler
  Dispatched when readURL is used and a the server sends a HTTP status code.GraphMLIOHandler
  Dispatched when readURL is used and an IO error occurs.GraphMLIOHandler
  Dispatched when readURL is used and a security error occurs.GraphMLIOHandler
Property Detail
_edgeOutputHandlersproperty
protected var _edgeOutputHandlers:List

The installed edge output handlers

_graphMLOutputHandlersproperty 
protected var _graphMLOutputHandlers:List

The installed graphml output handlers

_graphOutputHandlersproperty 
protected var _graphOutputHandlers:List

The installed graph output handlers

_inputHandlersproperty 
protected var _inputHandlers:List

The installed input handlers

_namespacesproperty 
protected var _namespaces:ArrayList

The installed namespaces

_nodeOutputHandlersproperty 
protected var _nodeOutputHandlers:List

The installed node output handlers

_portOutputHandlersproperty 
protected var _portOutputHandlers:List

The installed port output handlers

adjustFontSizeproperty 
adjustFontSize:Boolean

Whether to adjust the font size when serializing / deserializing fonts.

On reading the Font size will be multiplied by the factor specified by fontSizeFactor. On writing, the font will be divided by that factor. This is necessary when deserializing a font from a .NET server, because .NET interprets the font size as points (1/72 inch) whereas Flex interprets the size as pixel (1/96 inch).

The default value is false.


Implementation
    public function get adjustFontSize():Boolean
    public function set adjustFontSize(value:Boolean):void
clearGraphBeforeReadproperty 
clearGraphBeforeRead:Boolean

Whether to clear an existing graph instance before reading.

If set to true, an existing graph instance will be cleared before the graph is read into this instance, otherwise the loaded graph will be merged into the existing one.

The default value is true.


Implementation
    public function get clearGraphBeforeRead():Boolean
    public function set clearGraphBeforeRead(value:Boolean):void
fontSizeFactorproperty 
fontSizeFactor:Number

The factor to adjust the font size when serializing / deserializing fonts.

If adjustFontSize is set to true, on reading the Font size will be multiplied by this factor. On writing, the font will be divided by this factor. This is necessary when deserializing a font from a .NET server, because .NET interprets the font size as points (1/72 inch) whereas Flex interprets the size as pixel (1/96 inch).

The default value is 0.75.


Implementation
    public function get fontSizeFactor():Number
    public function set fontSizeFactor(value:Number):void
inputHandlerProviderproperty 
inputHandlerProvider:IInputHandlerProvider

Gets or sets an IInputHandlerProvider instance for dynamic input handler retrieval.


Implementation
    public function get inputHandlerProvider():IInputHandlerProvider
    public function set inputHandlerProvider(value:IInputHandlerProvider):void

See also

localViewModeproperty 
localViewMode:Boolean

Whether to read/write only the local view for folded graphs.

If an IFoldedGraph is found in the graph's lookup, the folded graph's master graph will be written instead, including all view states. This behavior can be prevented by enabling localViewMode. In local view mode, only a single view is read/written to/from the folded graph instance passed to the read/write method.

The default value is false.


Implementation
    public function get localViewMode():Boolean
    public function set localViewMode(value:Boolean):void

See also

outputHandlerProviderproperty 
outputHandlerProvider:IOutputHandlerProvider

Gets or sets an IOutputHandlerProvider instance for dynamic output handler retrieval.


Implementation
    public function get outputHandlerProvider():IOutputHandlerProvider
    public function set outputHandlerProvider(value:IOutputHandlerProvider):void

See also

parseErrorHandlerproperty 
parseErrorHandler:IGraphMLParseErrorHandler

An error handler that will be used to handle errors which occur during parsing.


Implementation
    public function get parseErrorHandler():IGraphMLParseErrorHandler
    public function set parseErrorHandler(value:IGraphMLParseErrorHandler):void
readLabelsproperty 
readLabels:Boolean

Whether labels should be deserialized.

The default value is true.


Implementation
    public function get readLabels():Boolean
    public function set readLabels(value:Boolean):void
readMajorVersionproperty 
readMajorVersion:int

The major file format version for the input.

If this property is set, it forces the parser to read the specified major version format.

If the value of this property is null (the default), the version attribute of the graphml element in the parsed file determines the major version.

The default value is -1.


Implementation
    public function get readMajorVersion():int
    public function set readMajorVersion(value:int):void

See also

readMinorVersionproperty 
readMinorVersion:int

The minor file format version for the input.

If this property is set, it forces the parser to read the specified minor version format.

If the value of this property is null (the default), the version attribute of the graphml element in the parsed file determines the minor version.

The default value is -1.


Implementation
    public function get readMinorVersion():int
    public function set readMinorVersion(value:int):void

See also

readPortLocationModelproperty 
readPortLocationModel:Boolean

Whether port location models should be deserialized.

If true, the read port location model takes precedence over a deserialized port layout when using an AbstractRoundtripHandler with readPortLayout property set to true.

The default value is false.


Implementation
    public function get readPortLocationModel():Boolean
    public function set readPortLocationModel(value:Boolean):void

See also

readRealizersproperty 
readRealizers:Boolean

Whether styles should be deserialized from realizers.

The default value is false.


Implementation
    public function get readRealizers():Boolean
    public function set readRealizers(value:Boolean):void
readStylesproperty 
readStyles:Boolean

Whether styles should be deserialized.

The default value is false.


Implementation
    public function get readStyles():Boolean
    public function set readStyles(value:Boolean):void
readTablesproperty 
readTables:Boolean

Whether to read tables.

If enabled new tables will be written to a mapper with the key TableUtils.TABLE_MAPPER_ID. It is up to the developer to transfer the tables from that mapper to the correct table holder, e.g. a TableNodeStyle's table. GraphCanvasComponent.morphGraph() does this automatically.

The default value is false.


Implementation
    public function get readTables():Boolean
    public function set readTables(value:Boolean):void

See also

realizerSerializerManagerproperty 
realizerSerializerManager:RealizerSerializerManager  [read-only]

Get the RealizerSerializerManager instance used by this GraphMLIOHandler. This allows to set/add/remove IRealizerSerializers for a specific handler instance.


Implementation
    public function get realizerSerializerManager():RealizerSerializerManager
supportUserTagsproperty 
supportUserTags:Boolean

Whether to support user tags at ModelItems automatically.

If enabled, user tag objects (which can be retrieved via the ITagOwner interface) are (de)serialized automatically if possible, by means of associated GraphML (de)serializers.

The default value is false.


Implementation
    public function get supportUserTags():Boolean
    public function set supportUserTags(value:Boolean):void
supportZOrderproperty 
supportZOrder:Boolean

Whether to support z-orders of IModelItems automatically.

If enabled, z-order values (which can be retrieved via the IZOrderSupport interface) are (de)serialized automatically if possible, by means of associated GraphML (de)serializers.

The default value is false.


Implementation
    public function get supportZOrder():Boolean
    public function set supportZOrder(value:Boolean):void
tagMapperproperty 
tagMapper:IMapper  [read-only]


Implementation
    yworks_internal function get tagMapper():IMapper
writeLabelsproperty 
writeLabels:Boolean

Whether labels should be serialized.

The default value is true.


Implementation
    public function get writeLabels():Boolean
    public function set writeLabels(value:Boolean):void
writeMajorVersionproperty 
writeMajorVersion:int

The major file format version for the output

The default value is com.yworks.io.graphml.GraphMLConstants#DEFAULT_FILE_VERSION_MAJOR.


Implementation
    public function get writeMajorVersion():int
    public function set writeMajorVersion(value:int):void

See also

writeMinorVersionproperty 
writeMinorVersion:int

The minor file format version for the output

The default value is com.yworks.io.graphml.GraphMLConstants#DEFAULT_FILE_VERSION_MINOR.


Implementation
    public function get writeMinorVersion():int
    public function set writeMinorVersion(value:int):void

See also

writePortLocationModelproperty 
writePortLocationModel:Boolean

Whether port location models should be serialized.

The default value is false.


Implementation
    public function get writePortLocationModel():Boolean
    public function set writePortLocationModel(value:Boolean):void

See also

writeRealizersproperty 
writeRealizers:Boolean

Whether styles should be serialized as realizers.

The default value is false.


Implementation
    public function get writeRealizers():Boolean
    public function set writeRealizers(value:Boolean):void
writeSharedReferencesproperty 
writeSharedReferences:Boolean

Whether to support object sharing on output.

If enabled, multiple object references will be correctly represented in the output document, otherwise, each object reference will be serialized independently.

This property only applies to style serialization for the yFiles FLEX/.NET GraphML extension. Therefore, it only affects the GraphML output, if writeStyles is set to true.

The default value is true.


Implementation
    public function get writeSharedReferences():Boolean
    public function set writeSharedReferences(value:Boolean):void

See also

writeStylesproperty 
writeStyles:Boolean

Whether styles should be serialized.

The default value is false.


Implementation
    public function get writeStyles():Boolean
    public function set writeStyles(value:Boolean):void
writeTablesproperty 
writeTables:Boolean

Whether to write tables. If this property is enabled the tables are written as mapped attribute.

Tables which are part of a style (TableNodeStyle) are serialized together with that style if writeStyles is enabled. Therefore, enabling writeTables is only necessary if writeStyles is disabled.

Also, if this property is enabled and writeStyles is enabled, the table's styles are written, too. If writeStyles is disabled only the table's layout is written.

The default value is false.


Implementation
    public function get writeTables():Boolean
    public function set writeTables(value:Boolean):void
Constructor Detail
GraphMLIOHandler()Constructor
public function GraphMLIOHandler()

Constructor. initializes the default style input handlers.

Method Detail
addEdgeAttribute()method
public function addEdgeAttribute(mapper:IMapper, attrName:String, type:String = string):void

Adds a GraphML attribute with edge scope that holds data of simple type.

Parameters

mapper:IMapper — The mapper that is accessed by the output handler whenever actual data for an edge is to be written to a GraphML file.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

addGraphAttribute()method 
public function addGraphAttribute(mapper:IMapper, attrName:String, type:String = string):void

Adds a GraphML attribute with graph scope that holds data of simple type.

Parameters

mapper:IMapper — The mapper that is accessed by the output handler whenever actual data for the graph is to be written to a GraphML file.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

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

Adds a input handler that can parse <data> blocks.

The scope is determined by the for attribute of the corresponding key node

Parameters

handler:IInputHandler — the input handler to add

addNamespace()method 
public function addNamespace(ns:Namespace):void

Adds a namespace to the header of a GraphML file.

Parameters

ns:Namespace — the namespace to add.

addNodeAttribute()method 
public function addNodeAttribute(mapper:IMapper, attrName:String, type:String = string):void

Adds a GraphML attribute with node scope that holds data of simple type.

Parameters

mapper:IMapper — The mapper that is accessed by the output handler whenever actual data for a node is to be written to a GraphML file.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

addOutputHandler()method 
public function addOutputHandler(outputHandler:IOutputHandler, scope:String):void

Adds a subordinate output handler for the given element scope to this GraphMLIOHandler.

Parameters

outputHandler:IOutputHandler — the output handler to be added.
 
scope:String — Scope specifier. one of GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE, or GraphMLConstants.SCOPE_EDGE.

addRegistryEdgeAttribute()method 
public function addRegistryEdgeAttribute(registryTag:Object, attrName:String, type:String = string):void

Adds a GraphML attribute with edge scope that holds data of simple type.

Parameters

registryTag:Object — The tag that is used to retrieve the mapper instance from the graph's mapper registry.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

addRegistryGraphAttribute()method 
public function addRegistryGraphAttribute(registryTag:Object, attrName:String, type:String = string):void

Adds a GraphML attribute with graph scope that holds data of simple type.

Parameters

registryTag:Object — The tag that is used to retrieve the mapper instance from the graph's mapper registry.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

addRegistryNodeAttribute()method 
public function addRegistryNodeAttribute(registryTag:Object, attrName:String, type:String = string):void

Adds a GraphML attribute with node scope that holds data of simple type.

Parameters

registryTag:Object — The tag that is used to retrieve the mapper instance from the graph's mapper registry.
 
attrName:String — The name that is used inside the GraphML file with the XML attr.name attribute of the GraphML <key> element.
 
type:String (default = string) — The attr.type of the attribute.

configureDeserializers()method 
protected function configureDeserializers(context:GraphMLParseContext):void

Sets up all default IDeserializer instances on context.

Parameters

context:GraphMLParseContext — The parse context that should be configured.

configureInputHandlers()method 
protected function configureInputHandlers(parser:GraphMLParser):void

Sets up all input handlers for the provided parser instance.

This implementation just assigns the IInputHandlerProvider instance set in the inputHandlerProvider property to corresponding inputHandlerProvider property of the parser.

Parameters

parser:GraphMLParser — The parser that should be configured.

configureSerializers()method 
protected function configureSerializers(context:GraphMLWriteContext):void

Configures context to use all registered serializers.

This implementation just registers all serializers that have been registered with registerDefaultSerializers() in a ISerializerRegistry instance present in context.

Parameters

context:GraphMLWriteContext — The context to configure.

createDirectGraphMLWriter()method 
protected function createDirectGraphMLWriter(graph:IGraph):DirectGraphMLWriter

Create the DirectGraphMLWriter instance that is used for writing GraphML output.

This method also creates the initial write context for the writer by calling createWriteContext

Parameters

graph:IGraph — The graph to create the writer for

Returns
DirectGraphMLWriter — the newly created writer.

See also

createGraphElementFactory()method 
protected function createGraphElementFactory(graph:IGraph):IGraphItemFactory

Create a suitable instance of IGraphElementFactory that can handle the given graph

Parameters

graph:IGraph — The graph that should be filled by this instance

Returns
IGraphItemFactory — A suitable instance of IGraphElementFactory that can handle the given graph
createGraphElementProvider()method 
protected function createGraphElementProvider(graph:IGraph):IGraphElementProvider

Create an IGraphElementProvider instance that provides the graph elements that are to be written.

Parameters

graph:IGraph — The graph instance to provide elements from.

Returns
IGraphElementProvider — The newly created graph element provider
createGraphMLParser()method 
protected function createGraphMLParser(graph:IGraph):GraphMLParser

Create the GraphMLParser instance that is used for writing GraphML output.

This method also creates the initial parse context for the parser by calling createParseContext

Parameters

graph:IGraph — The graph that is to be filled by the parser

Returns
GraphMLParser — the newly created GraphMLParser

See also

createParseContext()method 
protected function createParseContext(parser:GraphMLParser, graph:IGraph):GraphMLParseContext

Callback method for the creation of a new read context.

This method is called by createGraphMLParser

Parameters

parser:GraphMLParser — The reader to create the read context for.
 
graph:IGraph — The graph that is to be read by the reader

Returns
GraphMLParseContext — A context that can be passed to the reader as the initial context

See also

createWriteContext()method 
protected function createWriteContext(writer:DirectGraphMLWriter, graph:IGraph):GraphMLWriteContext

Callback method for the creation of a new write context.

This method is called by createDirectGraphMLWriter

Parameters

writer:DirectGraphMLWriter — The writer to create the write context for.
 
graph:IGraph — The graph that is to be written by the writer

Returns
GraphMLWriteContext — A context that can be passed to the core writer as initial context

See also

createXmlWriter()method 
protected function createXmlWriter():IXmlWriter

Create the IXmlWriter instance that is used for low-level XML writing.

Returns
IXmlWriter — The newly created IXmlWriter instance.
getInputHandlers()method 
public function getInputHandlers():Iterable

Returns an iterable view of all input handlers that have been registered with this instance.

Returns
Iterable — An Iterable of the registered input handlers.
getOutputHandlers()method 
public function getOutputHandlers(scope:String):Collection

Returns an editable view on the registered output handlers for GraphML attributes with given scope that are registered with this GraphMLIOHandler. Output handlers can be added or removed from the returned collection.

Parameters

scope:String — Scope specifier. one of GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE, or GraphMLConstants.SCOPE_EDGE.

Returns
Collection — All registered subordinate output handlers for GraphML attributes with given scope.
getRegisteredDeserializers()method 
public function getRegisteredDeserializers():Iterable

Returns an Iterable of all deserializers that have been registered with this instance.

Returns
Iterable — An Iterable of the registered deserializers.
getRegisteredSerializers()method 
public function getRegisteredSerializers():Iterable

Returns an iterable view of all serializers that have been registered with this instance.

Returns
Iterable — An Iterable of the registered serilaizers.
initializeHandlers()method 
protected function initializeHandlers():void

Callback for subclasses to register default data handlers. This implementation doesn't register any handlers.

read()method 
public function read(graph:IGraph, xml:XML):void

populate the given graph with the graph defined in the given xml file.

Parameters

graph:IGraph — The graph to populate.
 
xml:XML — The graphml file as a xml object.

readURL()method 
public function readURL(graph:IGraph, url:String):void

Populate the graph with the graph structure defined in a graph file located at the URL.

Parameters

graph:IGraph — the graph to fill.
 
url:String — An URL where a graph file is located.

registerDeserializer()method 
public function registerDeserializer(deserializer:IDeserializer):void

Register a IDeserializer instance for reading custom information.

Parameters

deserializer:IDeserializer — The deserializer to register.

registerSerializer()method 
public function registerSerializer(serializer:ISerializer):void

Register a ISerializer instance for writing custom information.

Parameters

serializer:ISerializer — The serializer to register.

removeInputHandler()method 
public function removeInputHandler(inputHandler:IInputHandler):void

Removes an input handler.

Parameters

inputHandler:IInputHandler — A previously added input handler that is to be removed.

removeOutputHandler()method 
public function removeOutputHandler(outputHandler:IOutputHandler, scope:String):void

Removes an output handler that was added for the given scope.

Parameters

outputHandler:IOutputHandler — The output handler to be removed.
 
scope:String — Scope specifier. one of GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE, or GraphMLConstants.SCOPE_EDGE.

unregisterDeserializer()method 
public function unregisterDeserializer(deserializer:IDeserializer):void

Unregister an IDeserializer instance that was previously registered.

Parameters

deserializer:IDeserializer — The deserializer to be deregistered.

unregisterSerializer()method 
public function unregisterSerializer(serializer:ISerializer):void

Unregister an ISerializer instance that was previously registered.

Parameters

serializer:ISerializer — The serializer to be deregistered.

write()method 
public function write(graph:IGraph):XML

Write the given graph to a XML Object in GraphML format. The exact output depends on the output handlers registered with this instance and on the readRealizers,writeRealizers,readStyles and writeStyles flags.

Parameters

graph:IGraph — The graph to be written.

Returns
XML — A XML object containing the GraphML output.

See also

Event Detail
graphChanged Event
Event Object Type: com.yworks.graph.model.GraphEvent
GraphEvent.type property = com.yworks.graph.model.GraphEvent.GRAPH_CHANGED

Dispatched when the io handler has finished parsing a graph. The GraphEvent kind is set to GraphEventKind.UPDATE.

The GraphEvent.GRAPH_CHANGED constant defines the value of the type property of the event object for a graphChanged event.
httpStatus Event  
Event Object Type: flash.events.HTTPStatusEvent
HTTPStatusEvent.type property = flash.events.HTTPStatusEvent.HTTP_STATUS

Dispatched when readURL is used and a the server sends a HTTP status code.

ioError Event  
Event Object Type: flash.events.IOErrorEvent
IOErrorEvent.type property = flash.events.IOErrorEvent.IO_ERROR

Dispatched when readURL is used and an IO error occurs.

securityError Event  
Event Object Type: flash.events.SecurityErrorEvent
SecurityErrorEvent.type property = flash.events.SecurityErrorEvent.SECURITY_ERROR

Dispatched when readURL is used and a security error occurs.