Home Manual Reference Source Test
public class | source

NodeId

Extends:

node-opcua/lib/datamodel/nodeid~OpcNodeId → NodeId

A wrapper around node-opcua~NodeId.

Test:

Static Method Summary

Static Public Methods
public static

Creates a new NodeId based on a file path.

Constructor Summary

Public Constructor
public

constructor(typeOrValue: node-opcua~NodeIdType | string | number, value: number | string, namespace: number)

Creates a new NodeId.

Member Summary

Public Members
public get

The node id's browsename as string.

public get

The node id's value, encoded to a file path.

public get
this get was deprecated. Doesn't work properly in some edge cases. Use AtviseFile#parentNodeId instead whenever possible.

The parent node id, or null.

Private Members
private get

Returns the last separator in a string node id's path, e.g.:

  • '/' for ns=1;SYSTEM.LIBRARY.RESOURCES/index.htm,
  • '.' for ns=1;AGENT.DISPLAYS.Main.

Method Summary

Public Methods
public

inspect(depth: number, options: Object): string

Returns a string in the format "namespace value" that is printed when inspecting the NodeId using util~inspect.

public

Checks if the node is a child of another.

Static Public Methods

public static fromFilePath(path: string): NodeId source

Creates a new NodeId based on a file path.

Params:

NameTypeAttributeDescription
path string

The file path to use.

Return:

NodeId

The resulting NodeId.

Public Constructors

public constructor(typeOrValue: node-opcua~NodeIdType | string | number, value: number | string, namespace: number) source

Creates a new NodeId. Can be called in multiple ways:

  • with a node-opcua~NodeIdType, a value and a namespace (defaults to 0),
  • with a value only (type will be taken from it, namespace defaults to 1) or
  • with a NodeIds string representation (for example ns=1;s=AGENT.DISPLAYS).

Params:

NameTypeAttributeDescription
typeOrValue node-opcua~NodeIdType | string | number

The type or value to use.

value number | string
  • optional

The value to use.

namespace number
  • optional
  • default: 1

The namespace to use.

Test:

Public Members

public get browseName: string source

The node id's browsename as string.

Test:

public get filePath: string source

The node id's value, encoded to a file path.

Test:

public get parent: NodeId source

this get was deprecated. Doesn't work properly in some edge cases. Use AtviseFile#parentNodeId instead whenever possible.

The parent node id, or null.

Test:

Private Members

private get _lastSeparator: string source

Returns the last separator in a string node id's path, e.g.:

  • '/' for ns=1;SYSTEM.LIBRARY.RESOURCES/index.htm,
  • '.' for ns=1;AGENT.DISPLAYS.Main.

Test:

Public Methods

public inspect(depth: number, options: Object): string source

Returns a string in the format "namespace value" that is printed when inspecting the NodeId using util~inspect.

Params:

NameTypeAttributeDescription
depth number

The depth to inspect.

options Object

The options to use.

Return:

string

A string in the format "namespace value".

Test:

See:

public isChildOf(parent: NodeId): boolean source

Checks if the node is a child of another.

Params:

NameTypeAttributeDescription
parent NodeId

The possible parent to check.

Return:

boolean

true if this is a child node of parent.

Test: