}
else {
try {
return (path.charAt(0) == '/') ? getSession().getNode(path) : getParent().getNode(path);
} catch (PathNotFoundException e) {
throw new ItemNotFoundException(path);
}
}
case PropertyType.STRING:
try {
Value refValue = ValueHelper.convert(value, PropertyType.REFERENCE, getValueFactory());
return getSession().getNodeByIdentifier(refValue.getString());
} catch (ItemNotFoundException e) {
throw e;
} catch (RepositoryException e) {
// try if STRING value can be interpreted as PATH value
Value pathValue = ValueHelper.convert(value, PropertyType.PATH, getValueFactory());
path = pathValue.getString();
try {
return (path.charAt(0) == '/') ? getSession().getNode(path) : getParent().getNode(path);
} catch (PathNotFoundException e1) {
throw new ItemNotFoundException(pathValue.getString());
}
}
default:
throw new ValueFormatException("Property value cannot be converted to a PATH, REFERENCE or WEAKREFERENCE");