public class TypeDictionary extends Object
| Constructor and Description |
|---|
TypeDictionary(UaClient client) |
| Modifier and Type | Method and Description |
|---|---|
ExtensionObject |
binaryEncode(Structure structure)
Encode a Structure that has been decoded previously with
decode(ExtensionObject). |
void |
clearCaches()
Clears all caches.
|
Structure |
decode(ExtensionObject extensionObject)
Try to decode a Structure, whose serializer is unknown.
|
UaDataTypeSpecification |
getDataTypeSpecification(UaNodeId id)
Returns an
UaDataTypeSpecification that matches the given DataType node id. |
EnumerationSpecification |
getEnumerationSpecification(UaNodeId id)
Returns an
EnumerationSpecification that matches the given Enumeration DataType node
id. |
OptionSetSpecification |
getOptionSetSpecification(UaNodeId id)
Returns a
OptionSetSpecification for the given id. |
SimpleTypeSpecification |
getSimpleTypeSpecification(UaNodeId id)
Returns an
SimpleTypeSpecification that matches the given DataType node id. |
StructureSpecification |
getStructureSpecification(UaNodeId id)
Returns a
StructureSpecification for the given id. |
void |
init()
Initializes the
TypeDictionary. |
void |
init(boolean shallow)
Initialize
TypeDictionary, on false works the same as init. |
boolean |
isUseParallelCalls()
Returns true if initialization process can use parallel calls to the server.
|
void |
refresh()
Refreshes the dictionary.
|
void |
setTreatNullDataTypeAsBaseDataType(boolean treatNullDataTypeAsBaseDataType)
This setting handles a workaround for servers that incorrectly use a Null NodeId instead of
having a proper DataTypeId in a StructureField definition of a StructureDefinition in the
DataTypeDefinition Attribute.
|
void |
setTreatOpcStringAsOpcCharArray(boolean treatOpcStringAsOpcCharArray)
This setting handles a workaround for servers erroneously describing DataType Strings in the
dictionaries as opc:String instead of opc:CharArray and still encoding the data as
opc:CharArray.
|
void |
setUseParallelCalls(boolean useParallelCalls)
Set to true if initialization process is allowed to use parallel calls to the server.
|
void |
setWarnOnlyOnErroneousDictionaries(boolean warnOnlyOnErroneousDictionaries)
This setting handles a workaround for servers erroneously failing to provide proper inverse
references from dictionary nodes to the datatype nodes.
|
public TypeDictionary(UaClient client)
public ExtensionObject binaryEncode(Structure structure) throws EncodingException
decode(ExtensionObject).structure - a structureEncodingException - if encoding cannot be donepublic void clearCaches()
public Structure decode(ExtensionObject extensionObject) throws DecodingException
clearCaches().extensionObject - the encoded StructureDecodingException - if decoding cannot be doneUaException - if typedictionary cannot be read from the serverpublic UaDataTypeSpecification getDataTypeSpecification(UaNodeId id)
UaDataTypeSpecification that matches the given DataType node id. Returns
null if not found or if the given id is not a DataType node.public EnumerationSpecification getEnumerationSpecification(UaNodeId id)
EnumerationSpecification that matches the given Enumeration DataType node
id. Returns null if not found or if the given id is not an Enumeration DataType.public OptionSetSpecification getOptionSetSpecification(UaNodeId id)
OptionSetSpecification for the given id. The given id can be an encoding or
type NodeId. Returns null if there is no StructureSpecification for the given id.public SimpleTypeSpecification getSimpleTypeSpecification(UaNodeId id)
SimpleTypeSpecification that matches the given DataType node id. Returns
null if not found or if the given id is not an DataType that classifies as "simple" (i.e. not a
Structure, Enumeration nor OptionSet type).public StructureSpecification getStructureSpecification(UaNodeId id)
StructureSpecification for the given id. The given id can be an encoding or
type NodeId. Returns null if there is no StructureSpecification for the given id.public void init()
throws TypeDictionaryException
TypeDictionary. This method blocks until all dictionaries are resolved,
which take some time.TypeDictionaryException - if dictionaries cannot be resolved to
StructureSpecificationspublic void init(boolean shallow)
throws TypeDictionaryException
TypeDictionary, on false works the same as init. If given true then
does nothing, but the TypeDictionary is considered as initialized.TypeDictionaryExceptionpublic boolean isUseParallelCalls()
public void refresh()
throws TypeDictionaryException
clearCaches() and init() after that, therefore
this method will block until all DataTypeDictionaries are read and resolved from the server.TypeDictionaryException - if an error happenspublic void setTreatNullDataTypeAsBaseDataType(boolean treatNullDataTypeAsBaseDataType)
public void setTreatOpcStringAsOpcCharArray(boolean treatOpcStringAsOpcCharArray)
public void setUseParallelCalls(boolean useParallelCalls)
public void setWarnOnlyOnErroneousDictionaries(boolean warnOnlyOnErroneousDictionaries)
Copyright © 2026. All rights reserved.