Class DataTypeTree
java.lang.Object
org.eclipse.milo.opcua.sdk.core.typetree.TypeTree<DataType>
org.eclipse.milo.opcua.sdk.core.typetree.DataTypeTree
A tree-based representation of a DataType hierarchy.
Allows for convenient operations such as:
- resolving the backing Class for a value of a given DataType
- reducing a DataType to its inherited builtin type
- checking if a Class would be assignable to a value of some DataType
- retrieving the encoding ids for structured DataTypes
- retrieving the DataTypeDefinition for structured and enumerated DataTypes
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.milo.opcua.sdk.core.typetree.TypeTree
TypeTree.Type -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>getBackingClass(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get the backing Class a value of DataTypedataTypeIdwould have.@Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeIdgetBinaryEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the Binary Encoding Node for the DataType identified bydataTypeId.org.eclipse.milo.opcua.stack.core.OpcUaDataTypegetBuiltinType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theOpcUaDataTypedataTypeIdinherits from, following references to the parent as necessary until aOpcUaDataTypeis found.@Nullable DataTypegetDataType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theDataTypeinfo for the DataType identified bydataTypeId, if it exists.@Nullable org.eclipse.milo.opcua.stack.core.types.structured.DataTypeDefinitiongetDataTypeDefinition(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theDataTypeDefinitionof the DataType identified bydataTypeId.@Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeIdgetJsonEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the JSON Encoding Node for the DataType identified bydataTypeId.@Nullable org.eclipse.milo.opcua.stack.core.util.Tree<DataType>getTreeNode(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get the underlyingTreenode for the DataType identified bydataTypeId.@Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeIdgetXmlEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the XML Encoding Node for the DataType identified bydataTypeId.booleanisAssignable(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId, Class<?> clazz) Check if a value of typeclazzis assignable to a value of DataTypedataTypeId, i.e. it is equal to or a subtype of the backing class fordataTypeId.booleanisEnumType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) booleanisStructType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Methods inherited from class org.eclipse.milo.opcua.sdk.core.typetree.TypeTree
containsType, getRoot, getType, isSubtypeOf, isSubtypeOf, isSubtypeOf, isSubtypeOf
-
Constructor Details
-
DataTypeTree
-
-
Method Details
-
getBackingClass
Get the backing Class a value of DataTypedataTypeIdwould have.Builtin DataTypes are backed by their intrinsic backing class.
Abstract types
NodeIds0.Number,NodeIds0.Integer, andNodeIds0.UIntegerare backed byNumber,Integer, andUIntegerrespectively.Enumerations are backed by
Integer.Structures are backed by
ExtensionObject.- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the backing Class a value of DataType
dataTypeIdwould have. - See Also:
-
OpcUaDataTypeOpcUaDataType.getBackingClass()
-
getBuiltinType
public org.eclipse.milo.opcua.stack.core.OpcUaDataType getBuiltinType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theOpcUaDataTypedataTypeIdinherits from, following references to the parent as necessary until aOpcUaDataTypeis found.- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the
OpcUaDataTypethis DataType inherits from.
-
getDataType
public @Nullable DataType getDataType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theDataTypeinfo for the DataType identified bydataTypeId, if it exists.- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the
DataTypeinfo for the DataType identified bydataTypeId, if it exists.
-
getBinaryEncodingId
public @Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getBinaryEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the Binary Encoding Node for the DataType identified bydataTypeId.- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the
NodeIdof the Binary Encoding Node, ornullif none exists.
-
getXmlEncodingId
public @Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getXmlEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the XML Encoding Node for the DataType identified bydataTypeId.- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the
NodeIdof the XML Encoding Node, ornullif none exists.
-
getJsonEncodingId
public @Nullable org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getJsonEncodingId(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theNodeIdof the JSON Encoding Node for the DataType identified bydataTypeId.- Parameters:
dataTypeId- theNodeIdof the DataType Node.- Returns:
- the
NodeIdof the JSON Encoding Node for the DataType identified bydataTypeId.
-
getDataTypeDefinition
public @Nullable org.eclipse.milo.opcua.stack.core.types.structured.DataTypeDefinition getDataTypeDefinition(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get theDataTypeDefinitionof the DataType identified bydataTypeId.Only Structured and Enumerated DataTypes have a
DataTypeDefinition.- Parameters:
dataTypeId- theNodeIdof the DataType Node.- Returns:
- the
DataTypeDefinitionof the DataType identified bydataTypeId.
-
isAssignable
public boolean isAssignable(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId, Class<?> clazz) Check if a value of typeclazzis assignable to a value of DataTypedataTypeId, i.e. it is equal to or a subtype of the backing class fordataTypeId.- Parameters:
dataTypeId- theNodeIdof a DataType Node.clazz- the backing Class to check.- Returns:
trueifclazzis equal to or a subtype of the backing class fordataTypeId.
-
isEnumType
public boolean isEnumType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) -
isStructType
public boolean isStructType(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) -
getTreeNode
public @Nullable org.eclipse.milo.opcua.stack.core.util.Tree<DataType> getTreeNode(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId dataTypeId) Get the underlyingTreenode for the DataType identified bydataTypeId.- Overrides:
getTreeNodein classTypeTree<DataType>- Parameters:
dataTypeId- theNodeIdof a DataType Node.- Returns:
- the underlying
Treenode for the DataType identified bydataTypeId.
-