Class GraphMLDeserializer<TVertex, TEdge, TGraph>
A GraphML (http://graphml.graphdrawing.org/) format deserializer.
Inherited Members
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 SourceDeserialize(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 |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
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. |