| Package | com.yworks.io.graphml |
| Class | public class GraphMLIOHandler |
| Inheritance | GraphMLIOHandler flash.events.EventDispatcher |
| Implements | IOHandler |
| Subclasses | DotnetCompatGraphMLIOHandler, JavaCompatGraphMLIOHandler, LayoutGraphMLIOHandler |
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.RoundtripSupport instance
to read and write GraphML data. RoundtripSupport will use preconfigured io handlers
for reading and writing.
As an alternative, DotnetCompatGraphMLIOHandler or JavaCompatGraphmlIOHandler
can be used.
See the See also
| Property | Defined by | ||
|---|---|---|---|
| clearGraphBeforeRead : Boolean
Whether to clear an existing graph instance before reading
If set to | GraphMLIOHandler | ||
| parseErrorHandler : IGraphMLParseErrorHandler
Gets or sets whether embedded resources should be evaluated.
| 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 | ||
| readRealizers : Boolean
Whether styles should be deserialized from realizers.
| GraphMLIOHandler | ||
| readStyles : Boolean
Whether styles should be deserialized.
| GraphMLIOHandler | ||
| realizerSerializerManager : RealizerSerializerManager
[read-only]
Get the
RealizerSerializerManager instance used by this
GraphMLIOHandler. | 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 | ||
| writeRealizers : Boolean
Whether styles should be serialized as realizers.
| GraphMLIOHandler | ||
| writeSharedReferences : Boolean
Get or set whether embedded resources should be written in a separate block.
| GraphMLIOHandler | ||
| writeStyles : Boolean
Whether styles should be serialized.
| GraphMLIOHandler | ||
| Property | Defined 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 | ||
| Method | Defined 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 | ||
|
addInputHandler(handler:IInputHandler):void
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 | ||
|
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 | ||
|
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.
| 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 | ||
|
populate the given
graph with the graph defined in the given xml file. | GraphMLIOHandler | ||
|
Populate the
graph with the graph structure defined
in a graph file located at the URL. | GraphMLIOHandler | ||
|
registerDeserializer(deserializer:IDeserializer):void
Register a
IDeserializer instance for reading custom information. | GraphMLIOHandler | ||
|
registerSerializer(serializer:ISerializer):void
Register a
ISerializer instance for writing custom information. | GraphMLIOHandler | ||
|
removeInputHandler(inputHandler:IInputHandler):void
Removes an input handler.
| GraphMLIOHandler | ||
|
removeOutputHandler(outputHandler:IOutputHandler, scope:String):void
Removes an output handler that was added for the given scope.
| GraphMLIOHandler | ||
|
unregisterDeserializer(deserializer:IDeserializer):void
Unregister an
IDeserializer instance that was previously registered. | GraphMLIOHandler | ||
|
unregisterSerializer(serializer:ISerializer):void
Unregister an
ISerializer instance that was previously registered. | GraphMLIOHandler | ||
|
Write the given graph to a XML Object in GraphML format.
| GraphMLIOHandler | ||
| Method | Defined by | ||
|---|---|---|---|
|
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 | ||
|
initializeHandlers():void
Callback for subclasses to register default data handlers.
| GraphMLIOHandler | ||
| 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 | |||
| clearGraphBeforeRead | property |
clearGraphBeforeRead:Boolean [read-write]Whether to clear an existing graph instance before reading
If set to true, an exisisting 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.
public function get clearGraphBeforeRead():Boolean
public function set clearGraphBeforeRead(value:Boolean):void
| _edgeOutputHandlers | property |
protected var _edgeOutputHandlers:ListThe installed edge output handlers
| _graphMLOutputHandlers | property |
protected var _graphMLOutputHandlers:ListThe installed graphml output handlers
| _graphOutputHandlers | property |
protected var _graphOutputHandlers:ListThe installed graph output handlers
| _inputHandlers | property |
protected var _inputHandlers:ListThe installed input handlers
| _namespaces | property |
protected var _namespaces:ArrayListThe installed namespaces
| _nodeOutputHandlers | property |
protected var _nodeOutputHandlers:ListThe installed node output handlers
| parseErrorHandler | property |
parseErrorHandler:IGraphMLParseErrorHandler [read-write]
Gets or sets whether embedded resources should be evaluated.
If false, no resources are read from an embedded resource data tag.
The exact behaviour in this case depends on the
InputHandler used (i.e. resolve an external URL instead). Default is true.
public function get parseErrorHandler():IGraphMLParseErrorHandler
public function set parseErrorHandler(value:IGraphMLParseErrorHandler):void
| _portOutputHandlers | property |
protected var _portOutputHandlers:ListThe installed port output handlers
| readLabels | property |
readLabels:Boolean [read-write]Whether labels should be deserialized.
The default value is true.
public function get readLabels():Boolean
public function set readLabels(value:Boolean):void
| readMajorVersion | property |
readMajorVersion:int [read-write]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.
public function get readMajorVersion():int
public function set readMajorVersion(value:int):void
See also
| readMinorVersion | property |
readMinorVersion:int [read-write]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.
public function get readMinorVersion():int
public function set readMinorVersion(value:int):void
See also
| readRealizers | property |
readRealizers:Boolean [read-write]Whether styles should be deserialized from realizers.
The default value is false.
public function get readRealizers():Boolean
public function set readRealizers(value:Boolean):void
| readStyles | property |
readStyles:Boolean [read-write]Whether styles should be deserialized.
The default value is false.
public function get readStyles():Boolean
public function set readStyles(value:Boolean):void
| realizerSerializerManager | property |
realizerSerializerManager:RealizerSerializerManager [read-only]
Get the RealizerSerializerManager instance used by this
GraphMLIOHandler.
This allows to set/add/remove IRealizerSerializers for a specific handler instance.
public function get realizerSerializerManager():RealizerSerializerManager
| writeLabels | property |
writeLabels:Boolean [read-write]Whether labels should be serialized.
The default value is true.
public function get writeLabels():Boolean
public function set writeLabels(value:Boolean):void
| writeMajorVersion | property |
writeMajorVersion:int [read-write]The major file format version for the output
The default value is com.yworks.io.graphml.GraphMLConstants#DEFAULT_FILE_VERSION_MAJOR.
public function get writeMajorVersion():int
public function set writeMajorVersion(value:int):void
See also
| writeMinorVersion | property |
writeMinorVersion:int [read-write]The minor file format version for the output
The default value is com.yworks.io.graphml.GraphMLConstants#DEFAULT_FILE_VERSION_MINOR.
public function get writeMinorVersion():int
public function set writeMinorVersion(value:int):void
See also
| writeRealizers | property |
writeRealizers:Boolean [read-write]Whether styles should be serialized as realizers.
The default value is false.
public function get writeRealizers():Boolean
public function set writeRealizers(value:Boolean):void
| writeSharedReferences | property |
writeSharedReferences:Boolean [read-write]
Get or set whether embedded resources should be written in a separate block.
If false, no resources are embedded in the graphml file. The exact behaviour in this case depends on the
OutputHandler used. Default is true.
public function get writeSharedReferences():Boolean
public function set writeSharedReferences(value:Boolean):void
| writeStyles | property |
writeStyles:Boolean [read-write]Whether styles should be serialized.
The default value is false.
public function get writeStyles():Boolean
public function set writeStyles(value:Boolean):void
| GraphMLIOHandler | () | constructor |
public function GraphMLIOHandler()Constructor. initializes the default style input handlers.
| addEdgeAttribute | () | method |
public function addEdgeAttribute(mapper:IMapper, attrName:String, type:String = "string"):voidAdds a GraphML attribute with edge scope that holds data of simple type.
Parametersmapper: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.
|
| addInputHandler | () | method |
public function addInputHandler(handler:IInputHandler):voidAdds a input handler that can parse <data> blocks.
The scope is determined by the for attribute of the corresponding key node
handler:IInputHandler — the input handler to add
|
| addNamespace | () | method |
public function addNamespace(ns:Namespace):voidAdds a namespace to the header of a GraphML file.
Parametersns:Namespace — the namespace to add.
|
| addNodeAttribute | () | method |
public function addNodeAttribute(mapper:IMapper, attrName:String, type:String = "string"):voidAdds a GraphML attribute with node scope that holds data of simple type.
Parametersmapper: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):voidAdds a subordinate output handler for the given element scope to this GraphMLIOHandler.
ParametersoutputHandler: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"):voidAdds a GraphML attribute with edge scope that holds data of simple type.
ParametersregistryTag: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"):voidAdds a GraphML attribute with node scope that holds data of simple type.
ParametersregistryTag: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.
|
| 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
graph:IGraph — The graph to create the writer for
|
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
graph:IGraph — The graph that should be filled by this instance
|
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.
graph:IGraph — The graph instance to provide elements from.
|
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
graph:IGraph — The graph that is to be filled by the parser
|
GraphMLParser —
the newly created GraphMLParser
|
See also
| createParseContext | () | method |
protected function createParseContext(parser:GraphMLParser, graph:IGraph):GraphMLParseContextCallback method for the creation of a new read context.
This method is called by createGraphMLParser
parser:GraphMLParser — The reader to create the read context for.
|
|
graph:IGraph — The graph that is to be read by the reader
|
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):GraphMLWriteContextCallback method for the creation of a new write context.
This method is called by createDirectGraphMLWriter
writer:DirectGraphMLWriter — The writer to create the write context for.
|
|
graph:IGraph — The graph that is to be written by the writer
|
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.
IXmlWriter —
The newly created IXmlWriter instance.
|
| getInputHandlers | () | method |
public function getInputHandlers():IterableReturns an iterable view of all input handlers that have been registered with this instance.
ReturnsIterable —
An Iterable of the registered input handlers.
|
| getOutputHandlers | () | method |
public function getOutputHandlers(scope:String):CollectionReturns 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.
Parametersscope:String — Scope specifier. one of GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE,
or GraphMLConstants.SCOPE_EDGE.
|
Collection —
All registered subordinate output handlers for GraphML attributes with given scope.
|
| getRegisteredDeserializers | () | method |
public function getRegisteredDeserializers():IterableReturns an Iterable of all deserializers that have been registered with this instance.
ReturnsIterable —
An Iterable of the registered deserializers.
|
| getRegisteredSerializers | () | method |
public function getRegisteredSerializers():IterableReturns an iterable view of all serializers that have been registered with this instance.
ReturnsIterable —
An Iterable of the registered serilaizers.
|
| initializeHandlers | () | method |
protected function initializeHandlers():voidCallback 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.
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.
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.
deserializer:IDeserializer — The deserializer to register.
|
| registerSerializer | () | method |
public function registerSerializer(serializer:ISerializer):void
Register a ISerializer instance for writing custom information.
serializer:ISerializer — The serializer to register.
|
| removeInputHandler | () | method |
public function removeInputHandler(inputHandler:IInputHandler):voidRemoves an input handler.
ParametersinputHandler:IInputHandler — A previously added input handler that is to be removed.
|
| removeOutputHandler | () | method |
public function removeOutputHandler(outputHandler:IOutputHandler, scope:String):voidRemoves an output handler that was added for the given scope.
ParametersoutputHandler: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.
deserializer:IDeserializer — The deserializer to be deregistered.
|
| unregisterSerializer | () | method |
public function unregisterSerializer(serializer:ISerializer):void
Unregister an ISerializer instance that was previously registered.
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.
graph:IGraph — The graph to be written.
|
XML — A XML object containing the GraphML output.
|
See also
| graphChanged | event |
com.yworks.graph.model.GraphEvent
Dispatched when the io handler has finished parsing a graph. The GraphEvent kind is set to GraphEventKind.UPDATE.
| httpStatus | event |
flash.events.HTTPStatusEvent
Dispatched when readURL is used and a the server sends a HTTP status code.
| ioError | event |
flash.events.IOErrorEvent
Dispatched when readURL is used and an IO error occurs.
| securityError | event |
flash.events.SecurityErrorEvent
Dispatched when readURL is used and a security error occurs.