public class NamespaceTable extends UriTable<UaNamespace>
OPCUA_NAMESPACE is always in index 0. NOTE! Each "context" can have a
different mapping table i.e. when loading NodeSet2 XMLs, the model has it's own mapping table,
whose indexes differ form the server NamespaceArray node mappings (which are also typically
represented by a NamespaceTable by the SDK).
Use UriTable.add(int, java.lang.String) to add entries to the table. Use getIndex(java.lang.String) to find the index of an URI
or UriTable.getUri(int) to find the Uri of an index.
| Modifier and Type | Field and Description |
|---|---|
static String |
OPCUA_NAMESPACE
The core NamespaceUri of the base specification of OPC UA, which is always in NamespaceIndex 0.
|
| Constructor and Description |
|---|
NamespaceTable()
Constructor for NamespaceTable.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(UaNamespace namespace)
Returns true if this
NamespaceTable contains a mapping for the given
UaNamespace, false otherwise. |
static NamespaceTable |
createFromArray(String[] namespaceArray)
createFromArray.
|
static NamespaceTable |
getDefaultInstance()
Getter for the field
defaultInstance. |
int |
getIndex(String namespaceUri)
Finds the index of the namespace URI in the table.
|
UaNamespace |
getNamespace(int namespaceIndex)
Returns
UaNamespace that matches the given index in this table, null if there is no
mapping. |
UaNamespace |
getNamespace(String namespaceUri)
Returns
UaNamespace that has the given NamespaceUri, if this table contains an index
mapping for that uri, otherwise returns null. |
boolean |
namespaceEquals(ExpandedNodeId expandedNodeId1,
ExpandedNodeId expandedNodeId2)
Check if the node IDs refer to the same name space.
|
boolean |
namespaceEquals(NodeId nodeId,
ExpandedNodeId expandedNodeId)
Check if the node IDs refer to the same name space.
|
boolean |
namespaceEquals(NodeId nodeId1,
NodeId nodeId2)
Check if the node IDs refer to the same name space.
|
boolean |
nodeIdEquals(ExpandedNodeId n1,
ExpandedNodeId n2)
Compare 2 ExpandedNodeId objects.
|
boolean |
nodeIdEquals(NodeId n1,
ExpandedNodeId n2)
Compare 1 ExpandedNodeId and 1 NodeId.
|
ExpandedNodeId |
toExpandedNodeId(NodeId nodeId)
Convert the NodeId to an ExpandedNodeId using the namespaceUris of the table.
|
NodeId |
toNodeId(ExpandedNodeId expandedNodeId)
Convert the expandedNodeId to a NodeId using the name space indexes of the table.
|
add, add, addAll, containsObject, getObjectByIndex, getObjectByUri, getUri, remove, remove, size, toArray, toStringgetNodeIdWithPreCalcHashCodepublic static final String OPCUA_NAMESPACE
public static NamespaceTable createFromArray(String[] namespaceArray)
createFromArray.
namespaceArray - an array of String objects.NamespaceTable object.public static NamespaceTable getDefaultInstance()
Getter for the field defaultInstance.
public boolean contains(UaNamespace namespace)
NamespaceTable contains a mapping for the given
UaNamespace, false otherwise.public int getIndex(String namespaceUri)
UriTablegetIndex in class UriTable<UaNamespace>namespaceUri - the URI of the namespace you are looking forpublic UaNamespace getNamespace(int namespaceIndex)
UaNamespace that matches the given index in this table, null if there is no
mapping.public UaNamespace getNamespace(String namespaceUri)
UaNamespace that has the given NamespaceUri, if this table contains an index
mapping for that uri, otherwise returns null.public boolean namespaceEquals(ExpandedNodeId expandedNodeId1, ExpandedNodeId expandedNodeId2)
expandedNodeId1 - a ExpandedNodeId object.expandedNodeId2 - a ExpandedNodeId object.ServiceResultException - if uris within the ids could not be converted to indexes.public boolean namespaceEquals(NodeId nodeId, ExpandedNodeId expandedNodeId)
nodeId - a NodeId object.expandedNodeId - a ExpandedNodeId object.ServiceResultException - if uris within the ids could not be converted to indexespublic boolean namespaceEquals(NodeId nodeId1, NodeId nodeId2)
public boolean nodeIdEquals(ExpandedNodeId n1, ExpandedNodeId n2)
n1 - firstn2 - secondServiceResultException - if uris cannot be converted to indexespublic boolean nodeIdEquals(NodeId n1, ExpandedNodeId n2)
n1 - firstn2 - secondServiceResultException - if uris cannot be converted to indexespublic ExpandedNodeId toExpandedNodeId(NodeId nodeId)
toNodeId(ExpandedNodeId) method.nodeId - the NodeId to convertpublic NodeId toNodeId(ExpandedNodeId expandedNodeId) throws ServiceResultException
expandedNodeId - the expanded node IDServiceResultException - if there is no entry for the
namespaceUri used in the expandedNodeIdCopyright © 2026. All rights reserved.