4.1.2 Direct Access

The most important direct access method is

Item Session.getItem(String abspath).

This method takes an absolute path and is used to jump directly to the indicated item (node or property):

// Directly get the property with

// the value of Avogadro's Number

// (i.e., 6.022 x 10^23)

Property myProperty =
(Property)mySession.getItem("/a/e/k");


// Directly convert to a double

double myDouble = myProperty.getDouble();


// The variable myDouble will contain the

// value 6.022 x 10^23



Another direct access method (though for nodes only, not properties) is,

Node Session.getNodeByUUID(String uuid).

This method can be used to access those nodes that have Universally Unique Identifiers (see 4.9 Referenceable Nodes):

// Assuming that the node /a/e is referenceable

// and has UUID 1111 2222 3333 4444, we get it

Node myNode =
mySession.getNodeByUUID("
1111 2222 3333 4444");


// and then get the property and convert it to a double

double myDouble = myNode.getProperty("k").getDouble();


// The variable myDouble will contain the

// value 6.022 x 10^23