C# Class Opc.Ua.XmlDecoder

Reads objects from a XML stream.
Inheritance: IDecoder, IDisposable
ファイルを表示 Open project: OPCFoundation/UA-.NETStandardLibrary Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the stream used for reading.

Close ( bool checkEof ) : void

Closes the stream used for reading.

Dispose ( ) : void

Frees any unmanaged resources.

LoadStringTable ( string tableName, string elementName, StringTable stringTable ) : bool

Initializes a string table from an XML stream.

Peek ( System.Xml.XmlNodeType nodeType ) : XmlQualifiedName

Returns the qualified name for the next element in the stream.

Peek ( string fieldName ) : bool

Returns true if the specified field is the next element to be extracted.

PopNamespace ( ) : void

Pops a namespace from the namespace stack.

PushNamespace ( string namespaceUri ) : void

Pushes a namespace onto the namespace stack.

ReadBoolean ( string fieldName ) : bool

Reads a boolean from the stream.

ReadBooleanArray ( string fieldName ) : BooleanCollection

Reads a boolean array from the stream.

ReadByte ( string fieldName ) : byte

Reads a byte from the stream.

ReadByteArray ( string fieldName ) : ByteCollection

Reads a byte array from the stream.

ReadByteString ( string fieldName ) : byte[]

Reads a byte string from the stream.

ReadByteStringArray ( string fieldName ) : ByteStringCollection

Reads a byte string array from the stream.

ReadDataValue ( string fieldName ) : Opc.Ua.DataValue

Reads an DataValue from the stream.

ReadDataValueArray ( string fieldName ) : DataValueCollection

Reads an DataValue array from the stream.

ReadDateTime ( string fieldName ) : System.DateTime

Reads a UTC date/time from the stream.

ReadDateTimeArray ( string fieldName ) : DateTimeCollection

Reads a UTC date/time array from the stream.

ReadDiagnosticInfo ( ) : DiagnosticInfo

Reads an DiagnosticInfo from the stream.

ReadDiagnosticInfo ( string fieldName ) : DiagnosticInfo

Reads an DiagnosticInfo from the stream.

ReadDiagnosticInfoArray ( string fieldName ) : DiagnosticInfoCollection

Reads an DiagnosticInfo array from the stream.

ReadDouble ( string fieldName ) : double

Reads a double from the stream.

ReadDoubleArray ( string fieldName ) : DoubleCollection

Reads a double array from the stream.

ReadEncodeable ( string fieldName, System systemType ) : IEncodeable

Reads an encodeable object from the stream.

ReadEncodeableArray ( string fieldName, System systemType ) : Array

Reads an encodeable object array from the stream.

ReadEnumerated ( string fieldName, System enumType ) : Enum

Reads an enumerated value from the stream.

ReadEnumeratedArray ( string fieldName, System enumType ) : Array

Reads an enumerated value array from the stream.

ReadExpandedNodeId ( string fieldName ) : Opc.Ua.ExpandedNodeId

Reads an ExpandedNodeId from the stream.

ReadExpandedNodeIdArray ( string fieldName ) : ExpandedNodeIdCollection

Reads an ExpandedNodeId array from the stream.

ReadExtensionObject ( string fieldName ) : Opc.Ua.ExtensionObject

Reads an extension object from the stream.

ReadExtensionObjectArray ( string fieldName ) : ExtensionObjectCollection

Reads an array of extension objects from the stream.

ReadExtensionObjectBody ( Opc.Ua.ExpandedNodeId typeId ) : object

Reads the body extension object from the stream.

ReadFloat ( string fieldName ) : float

Reads a float from the stream.

ReadFloatArray ( string fieldName ) : FloatCollection

Reads a float array from the stream.

ReadGuid ( string fieldName ) : Uuid

Reads a GUID from the stream.

ReadGuidArray ( string fieldName ) : UuidCollection

Reads a GUID array from the stream.

ReadInt16 ( string fieldName ) : short

Reads a short from the stream.

ReadInt16Array ( string fieldName ) : Int16Collection

Reads a short array from the stream.

ReadInt32 ( string fieldName ) : int

Reads an int from the stream.

ReadInt32Array ( string fieldName ) : Int32Collection

Reads a int array from the stream.

ReadInt64 ( string fieldName ) : long

Reads a long from the stream.

ReadInt64Array ( string fieldName ) : Int64Collection

Reads a long array from the stream.

ReadLocalizedText ( string fieldName ) : Opc.Ua.LocalizedText

Reads an LocalizedText from the stream.

ReadLocalizedTextArray ( string fieldName ) : LocalizedTextCollection

Reads an LocalizedText array from the stream.

ReadNodeId ( string fieldName ) : Opc.Ua.NodeId

Reads an NodeId from the stream.

ReadNodeIdArray ( string fieldName ) : NodeIdCollection

Reads an NodeId array from the stream.

ReadQualifiedName ( string fieldName ) : Opc.Ua.QualifiedName

Reads an QualifiedName from the stream.

ReadQualifiedNameArray ( string fieldName ) : QualifiedNameCollection

Reads an QualifiedName array from the stream.

ReadSByte ( string fieldName ) : sbyte

Reads a sbyte from the stream.

ReadSByteArray ( string fieldName ) : SByteCollection

Reads a sbyte array from the stream.

ReadStartElement ( ) : void

Returns the qualified name for the next element in the stream.

ReadStatusCode ( string fieldName ) : Opc.Ua.StatusCode

Reads an StatusCode from the stream.

ReadStatusCodeArray ( string fieldName ) : StatusCodeCollection

Reads an StatusCode array from the stream.

ReadString ( string fieldName ) : string

Reads a string from the stream.

ReadStringArray ( string fieldName ) : StringCollection

Reads a string array from the stream.

ReadUInt16 ( string fieldName ) : ushort

Reads a ushort from the stream.

ReadUInt16Array ( string fieldName ) : UInt16Collection

Reads a ushort array from the stream.

ReadUInt32 ( string fieldName ) : uint

Reads a uint from the stream.

ReadUInt32Array ( string fieldName ) : UInt32Collection

Reads a uint array from the stream.

ReadUInt64 ( string fieldName ) : ulong

Reads a ulong from the stream.

ReadUInt64Array ( string fieldName ) : UInt64Collection

Reads a ulong array from the stream.

ReadVariant ( string fieldName ) : Variant

Reads an Variant from the stream.

ReadVariantArray ( string fieldName ) : VariantCollection

Reads an Variant array from the stream.

ReadXmlElement ( string fieldName ) : XmlElement

Reads an XmlElement from the stream.

ReadXmlElementArray ( string fieldName ) : XmlElementCollection

Reads an XmlElement array from the stream.

SetMappingTables ( Opc.Ua.NamespaceTable namespaceUris, StringTable serverUris ) : void

Initializes the tables used to map namespace and server uris during decoding.

Skip ( XmlQualifiedName qname ) : void

Skips to the end of the specified element.

XmlDecoder ( ServiceMessageContext context ) : System

Initializes the object with default values.

XmlDecoder ( System systemType, XmlReader reader, ServiceMessageContext context ) : System

Initializes the object with a XML reader.

XmlDecoder ( XmlElement element, ServiceMessageContext context ) : System

Initializes the object with an XML element to parse.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

Private Methods

Method Description
BeginField ( string fieldName, bool isOptional ) : bool

Reads the start of filed where the presences of the xsi:nil attribute is not significant.

BeginField ( string fieldName, bool isOptional, bool &isNil ) : bool

Reads the start of field.

EndField ( string fieldName ) : void

Reads the end of a field.

ExtractXml ( StringBuilder builder ) : void

Exracts the XML from the reader.

Initialize ( ) : void

Sets private members to default values.

MoveToElement ( string elementName ) : bool

Moves to the next start element.

ReadMatrix ( string fieldName ) : System.Matrix

Reads an Matrix from the stream.

ReadString ( ) : string

Reads a string from the stream.

ReadVariantContents ( TypeInfo &typeInfo ) : object

Method Details

Close() public method

Closes the stream used for reading.
public Close ( ) : void
return void

Close() public method

Closes the stream used for reading.
public Close ( bool checkEof ) : void
checkEof bool
return void

Dispose() public method

Frees any unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void

LoadStringTable() public method

Initializes a string table from an XML stream.
public LoadStringTable ( string tableName, string elementName, StringTable stringTable ) : bool
tableName string Name of the table.
elementName string Name of the element.
stringTable StringTable The string table.
return bool

Peek() public method

Returns the qualified name for the next element in the stream.
public Peek ( System.Xml.XmlNodeType nodeType ) : XmlQualifiedName
nodeType System.Xml.XmlNodeType
return System.Xml.XmlQualifiedName

Peek() public method

Returns true if the specified field is the next element to be extracted.
public Peek ( string fieldName ) : bool
fieldName string
return bool

PopNamespace() public method

Pops a namespace from the namespace stack.
public PopNamespace ( ) : void
return void

PushNamespace() public method

Pushes a namespace onto the namespace stack.
public PushNamespace ( string namespaceUri ) : void
namespaceUri string
return void

ReadBoolean() public method

Reads a boolean from the stream.
public ReadBoolean ( string fieldName ) : bool
fieldName string
return bool

ReadBooleanArray() public method

Reads a boolean array from the stream.
public ReadBooleanArray ( string fieldName ) : BooleanCollection
fieldName string
return BooleanCollection

ReadByte() public method

Reads a byte from the stream.
public ReadByte ( string fieldName ) : byte
fieldName string
return byte

ReadByteArray() public method

Reads a byte array from the stream.
public ReadByteArray ( string fieldName ) : ByteCollection
fieldName string
return ByteCollection

ReadByteString() public method

Reads a byte string from the stream.
public ReadByteString ( string fieldName ) : byte[]
fieldName string
return byte[]

ReadByteStringArray() public method

Reads a byte string array from the stream.
public ReadByteStringArray ( string fieldName ) : ByteStringCollection
fieldName string
return ByteStringCollection

ReadDataValue() public method

Reads an DataValue from the stream.
public ReadDataValue ( string fieldName ) : Opc.Ua.DataValue
fieldName string
return Opc.Ua.DataValue

ReadDataValueArray() public method

Reads an DataValue array from the stream.
public ReadDataValueArray ( string fieldName ) : DataValueCollection
fieldName string
return DataValueCollection

ReadDateTime() public method

Reads a UTC date/time from the stream.
public ReadDateTime ( string fieldName ) : System.DateTime
fieldName string
return System.DateTime

ReadDateTimeArray() public method

Reads a UTC date/time array from the stream.
public ReadDateTimeArray ( string fieldName ) : DateTimeCollection
fieldName string
return DateTimeCollection

ReadDiagnosticInfo() public method

Reads an DiagnosticInfo from the stream.
public ReadDiagnosticInfo ( ) : DiagnosticInfo
return DiagnosticInfo

ReadDiagnosticInfo() public method

Reads an DiagnosticInfo from the stream.
public ReadDiagnosticInfo ( string fieldName ) : DiagnosticInfo
fieldName string
return DiagnosticInfo

ReadDiagnosticInfoArray() public method

Reads an DiagnosticInfo array from the stream.
public ReadDiagnosticInfoArray ( string fieldName ) : DiagnosticInfoCollection
fieldName string
return DiagnosticInfoCollection

ReadDouble() public method

Reads a double from the stream.
public ReadDouble ( string fieldName ) : double
fieldName string
return double

ReadDoubleArray() public method

Reads a double array from the stream.
public ReadDoubleArray ( string fieldName ) : DoubleCollection
fieldName string
return DoubleCollection

ReadEncodeable() public method

Reads an encodeable object from the stream.
public ReadEncodeable ( string fieldName, System systemType ) : IEncodeable
fieldName string
systemType System
return IEncodeable

ReadEncodeableArray() public method

Reads an encodeable object array from the stream.
public ReadEncodeableArray ( string fieldName, System systemType ) : Array
fieldName string
systemType System
return System.Array

ReadEnumerated() public method

Reads an enumerated value from the stream.
public ReadEnumerated ( string fieldName, System enumType ) : Enum
fieldName string
enumType System
return System.Enum

ReadEnumeratedArray() public method

Reads an enumerated value array from the stream.
public ReadEnumeratedArray ( string fieldName, System enumType ) : Array
fieldName string
enumType System
return System.Array

ReadExpandedNodeId() public method

Reads an ExpandedNodeId from the stream.
public ReadExpandedNodeId ( string fieldName ) : Opc.Ua.ExpandedNodeId
fieldName string
return Opc.Ua.ExpandedNodeId

ReadExpandedNodeIdArray() public method

Reads an ExpandedNodeId array from the stream.
public ReadExpandedNodeIdArray ( string fieldName ) : ExpandedNodeIdCollection
fieldName string
return ExpandedNodeIdCollection

ReadExtensionObject() public method

Reads an extension object from the stream.
public ReadExtensionObject ( string fieldName ) : Opc.Ua.ExtensionObject
fieldName string
return Opc.Ua.ExtensionObject

ReadExtensionObjectArray() public method

Reads an array of extension objects from the stream.
public ReadExtensionObjectArray ( string fieldName ) : ExtensionObjectCollection
fieldName string
return ExtensionObjectCollection

ReadExtensionObjectBody() public method

Reads the body extension object from the stream.
public ReadExtensionObjectBody ( Opc.Ua.ExpandedNodeId typeId ) : object
typeId Opc.Ua.ExpandedNodeId
return object

ReadFloat() public method

Reads a float from the stream.
public ReadFloat ( string fieldName ) : float
fieldName string
return float

ReadFloatArray() public method

Reads a float array from the stream.
public ReadFloatArray ( string fieldName ) : FloatCollection
fieldName string
return FloatCollection

ReadGuid() public method

Reads a GUID from the stream.
public ReadGuid ( string fieldName ) : Uuid
fieldName string
return Uuid

ReadGuidArray() public method

Reads a GUID array from the stream.
public ReadGuidArray ( string fieldName ) : UuidCollection
fieldName string
return UuidCollection

ReadInt16() public method

Reads a short from the stream.
public ReadInt16 ( string fieldName ) : short
fieldName string
return short

ReadInt16Array() public method

Reads a short array from the stream.
public ReadInt16Array ( string fieldName ) : Int16Collection
fieldName string
return Int16Collection

ReadInt32() public method

Reads an int from the stream.
public ReadInt32 ( string fieldName ) : int
fieldName string
return int

ReadInt32Array() public method

Reads a int array from the stream.
public ReadInt32Array ( string fieldName ) : Int32Collection
fieldName string
return Int32Collection

ReadInt64() public method

Reads a long from the stream.
public ReadInt64 ( string fieldName ) : long
fieldName string
return long

ReadInt64Array() public method

Reads a long array from the stream.
public ReadInt64Array ( string fieldName ) : Int64Collection
fieldName string
return Int64Collection

ReadLocalizedText() public method

Reads an LocalizedText from the stream.
public ReadLocalizedText ( string fieldName ) : Opc.Ua.LocalizedText
fieldName string
return Opc.Ua.LocalizedText

ReadLocalizedTextArray() public method

Reads an LocalizedText array from the stream.
public ReadLocalizedTextArray ( string fieldName ) : LocalizedTextCollection
fieldName string
return LocalizedTextCollection

ReadNodeId() public method

Reads an NodeId from the stream.
public ReadNodeId ( string fieldName ) : Opc.Ua.NodeId
fieldName string
return Opc.Ua.NodeId

ReadNodeIdArray() public method

Reads an NodeId array from the stream.
public ReadNodeIdArray ( string fieldName ) : NodeIdCollection
fieldName string
return NodeIdCollection

ReadQualifiedName() public method

Reads an QualifiedName from the stream.
public ReadQualifiedName ( string fieldName ) : Opc.Ua.QualifiedName
fieldName string
return Opc.Ua.QualifiedName

ReadQualifiedNameArray() public method

Reads an QualifiedName array from the stream.
public ReadQualifiedNameArray ( string fieldName ) : QualifiedNameCollection
fieldName string
return QualifiedNameCollection

ReadSByte() public method

Reads a sbyte from the stream.
public ReadSByte ( string fieldName ) : sbyte
fieldName string
return sbyte

ReadSByteArray() public method

Reads a sbyte array from the stream.
public ReadSByteArray ( string fieldName ) : SByteCollection
fieldName string
return SByteCollection

ReadStartElement() public method

Returns the qualified name for the next element in the stream.
public ReadStartElement ( ) : void
return void

ReadStatusCode() public method

Reads an StatusCode from the stream.
public ReadStatusCode ( string fieldName ) : Opc.Ua.StatusCode
fieldName string
return Opc.Ua.StatusCode

ReadStatusCodeArray() public method

Reads an StatusCode array from the stream.
public ReadStatusCodeArray ( string fieldName ) : StatusCodeCollection
fieldName string
return StatusCodeCollection

ReadString() public method

Reads a string from the stream.
public ReadString ( string fieldName ) : string
fieldName string
return string

ReadStringArray() public method

Reads a string array from the stream.
public ReadStringArray ( string fieldName ) : StringCollection
fieldName string
return StringCollection

ReadUInt16() public method

Reads a ushort from the stream.
public ReadUInt16 ( string fieldName ) : ushort
fieldName string
return ushort

ReadUInt16Array() public method

Reads a ushort array from the stream.
public ReadUInt16Array ( string fieldName ) : UInt16Collection
fieldName string
return UInt16Collection

ReadUInt32() public method

Reads a uint from the stream.
public ReadUInt32 ( string fieldName ) : uint
fieldName string
return uint

ReadUInt32Array() public method

Reads a uint array from the stream.
public ReadUInt32Array ( string fieldName ) : UInt32Collection
fieldName string
return UInt32Collection

ReadUInt64() public method

Reads a ulong from the stream.
public ReadUInt64 ( string fieldName ) : ulong
fieldName string
return ulong

ReadUInt64Array() public method

Reads a ulong array from the stream.
public ReadUInt64Array ( string fieldName ) : UInt64Collection
fieldName string
return UInt64Collection

ReadVariant() public method

Reads an Variant from the stream.
public ReadVariant ( string fieldName ) : Variant
fieldName string
return Variant

ReadVariantArray() public method

Reads an Variant array from the stream.
public ReadVariantArray ( string fieldName ) : VariantCollection
fieldName string
return VariantCollection

ReadXmlElement() public method

Reads an XmlElement from the stream.
public ReadXmlElement ( string fieldName ) : XmlElement
fieldName string
return System.Xml.XmlElement

ReadXmlElementArray() public method

Reads an XmlElement array from the stream.
public ReadXmlElementArray ( string fieldName ) : XmlElementCollection
fieldName string
return System.Xml.XmlElementCollection

SetMappingTables() public method

Initializes the tables used to map namespace and server uris during decoding.
public SetMappingTables ( Opc.Ua.NamespaceTable namespaceUris, StringTable serverUris ) : void
namespaceUris Opc.Ua.NamespaceTable The namespaces URIs referenced by the data being decoded.
serverUris StringTable The server URIs referenced by the data being decoded.
return void

Skip() public method

Skips to the end of the specified element.
public Skip ( XmlQualifiedName qname ) : void
qname System.Xml.XmlQualifiedName The qualified name of the element to skip.
return void

XmlDecoder() public method

Initializes the object with default values.
public XmlDecoder ( ServiceMessageContext context ) : System
context ServiceMessageContext
return System

XmlDecoder() public method

Initializes the object with a XML reader.
public XmlDecoder ( System systemType, XmlReader reader, ServiceMessageContext context ) : System
systemType System
reader XmlReader
context ServiceMessageContext
return System

XmlDecoder() public method

Initializes the object with an XML element to parse.
public XmlDecoder ( XmlElement element, ServiceMessageContext context ) : System
element System.Xml.XmlElement
context ServiceMessageContext
return System