getValueAtPath

Get child node value or child node attribute value at path.

The first node at the specified path is returned.

See getChildAtPath for the description of path. The path may end with "?attribute"; in that case, the value of the specified attribute is returned instead.

Observe: Because this method can return null, the following code is incorrect and can throw NullPointerException:

if (tree.getValueAtPath(PATH).equals(VALUE))
{
    …
}
The correct way is to compare it the other way around:
if (VALUE.equals(tree.getValueAtPath(PATH))
{
    …
}

Return

The child node value or the child node attribute value, or null if no such child or attribute.

Parameters

path

The path to the child node.