Show / Hide Table of Contents

Class GraphMLDeserializer<TVertex, TEdge, TGraph>

A GraphML (http://graphml.graphdrawing.org/) format deserializer.

Inheritance
System.Object
SerializerBase
GraphMLDeserializer<TVertex, TEdge, TGraph>
Inherited Members
SerializerBase.EmitDocumentDeclaration
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Serialization
Assembly: QuikGraph.Serialization.dll
Syntax
public sealed class GraphMLDeserializer<TVertex, TEdge, TGraph> : SerializerBase where TEdge : IEdge<TVertex> where TGraph : IMutableVertexAndEdgeSet<TVertex, TEdge>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

TGraph

Graph type.

Remarks

Custom vertex, edge and graph attributes can be specified by using the System.Xml.Serialization.XmlAttributeAttribute attribute on properties (field not supported).

The serializer uses LCG (lightweight code generation) to generate the methods that writes the attributes to avoid paying the price of Reflection on each vertex/edge. Since nothing is for free, the first time you will use the serializer *on a particular pair of types*, it will have to bake that method.

Hyper edge, nodes, nested graphs not supported.

Methods

| Improve this Doc View Source

Deserialize(XmlReader, TGraph, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)

Deserializes a graph instance from the given reader into the given graph.

Declaration
public void Deserialize(XmlReader reader, TGraph graph, IdentifiableVertexFactory<TVertex> vertexFactory, IdentifiableEdgeFactory<TVertex, TEdge> edgeFactory)
Parameters
Type Name Description
System.Xml.XmlReader reader

The XML reader.

TGraph graph

Graph instance to fill.

IdentifiableVertexFactory<TVertex> vertexFactory

Vertex factory method.

IdentifiableEdgeFactory<TVertex, TEdge> edgeFactory

Edge factory method.

Exceptions
Type Condition
System.ArgumentNullException

reader is null.

System.ArgumentNullException

graph is null.

System.ArgumentNullException

vertexFactory is null.

System.ArgumentNullException

edgeFactory is null.

System.InvalidOperationException

Deserializing value on property without setter, or with invalid default value.

System.InvalidOperationException

QuikGraph.Serialization.XmlConstants.GraphMLTag or QuikGraph.Serialization.XmlConstants.GraphTag not found.

System.InvalidOperationException

Failure while reading elements from GraphML.

System.NotSupportedException

Deserializing graph with unsupported property type.

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph