Returns the ancestor of this Item at the specified depth. An ancestor of depth x is the Item that is x levels down along the path from the root node to this Item. depth = 0 returns the root node of a workspace. depth = 1 returns the child of the root node along the path to this Item. depth = 2 returns the grandchild of the root node along the path to this Item. And so on to depth = n, where n is the depth of this Item, which returns this Item itself.
If this node has more than one path (i.e., if it is a descendant of a shared node) then the path used to define the ancestor is implementaion-dependent.
An integer, 0 <= depth <= n where n is the depth of this Item.
The ancestor of this Item at the specified depth.
ItemNotFoundException if depth < 0 or depth > n where n is the is the depth of this item.
AccessDeniedException if the current session does not have sufficent access to retrieve the specified node.
RepositoryException if another error occurs.
Returns a Binary representation of the value of this property. A shortcut for Property.getValue().getBinary().
A Binary representation of the value of this property.
ValueFormatException if the property is multi-valued.
RepositoryException if another error occurs.
JCR 2.0
Returns a boolean representation of the value of this property. A shortcut for Property.getValue().getBoolean().
A boolean representation of the value of this property.
ValueFormatException if conversion to a boolean is not possible or if the property is multi-valued.
RepositoryException if another error occurs.
Value
Returns the depth of this Item in the workspace item graph. The root node returns 0. A property or child node of the root node returns 1. A property or child node of a child node of the root returns 2. And so on to this Item.
The depth of this Item in the workspace item graph.
RepositoryException if an error occurs.
Returns a double representation of the value of this property. A shortcut for Property.getValue().getDouble().
A double representation of the value of this property.
ValueFormatException if conversion to a double is not possible or if the property is multi-valued.
RepositoryException if another error occurs.
Value
Returns the length of the value of this property.
For a BINARY property, getLength returns the number of bytes. For other property types, getLength returns the same value that would be returned by calling java.lang.String#length() on the value when it has been converted to a STRING according to standard JCR property type conversion.
Returns -1 if the implementation cannot determine the length.
an long.
ValueFormatException if this property is multi-valued.
RepositoryException if another error occurs.
Returns an array holding the lengths of the values of this (multi-value) property in bytes where each is individually calculated as described in #getLength().
Returns a -1 in the appropriate position if the implementation cannot determine the length of a value.
an array of lengths
ValueFormatException if this property is single-valued.
RepositoryException if another error occurs.
Returns a long representation of the value of this property. A shortcut for Property.getValue().getLong().
A long representation of the value of this property.
ValueFormatException if conversion to a long is not possible or if the property is multi-valued.
RepositoryException if another error occurs.
Value
Returns the name of this Item in qualified form. If this Item is the root node of the workspace, an empty string is returned.
the name of this Item in qualified form or an empty string if this Item is the root node of a workspace.
RepositoryException if an error occurs.
If this property is of type REFERENCE, WEAKREFERENCE or PATH (or convertible to one of these types) this method returns the Node to which this property refers.
If this property is of type PATH and it contains a relative path, it is interpreted relative to the parent node of this property. For example "." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling node of this property.
the referenced Node
ValueFormatException if this property cannot be converted to a referring type (REFERENCE, WEAKREFERENCE or PATH), if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage.
ItemNotFoundException If this property is of type PATH or WEAKREFERENCE and no target node accessible by the current Session exists in this workspace. Note that this applies even if the property is a PATHS and a property exists at the specified location. To dereference to a target property (as opposed to a target node), the method Property.getProperty is used.
RepositoryException if another error occurs.
Returns the parent of this Item.
The parent of this Item.
ItemNotFoundException if this Item is the root node of a workspace.
AccessDeniedException if the current session does not have sufficent access to retrieve the parent of this item.
RepositoryException if another error occurs.
If this property is of type PATH (or convertible to this type) this method returns the Property to which this property refers.
If this property contains a relative path, it is interpreted relative to the parent node of this property. Therefore, when resolving such a relative path, the segment "." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling property of this property or this property itself.
For example, if this property is located at /a/b/c and it has a value of "../d" then this method will return the property at /a/d if such exists.
If this property is multi-valued, this method throws a ValueFormatException.
If this property cannot be converted to a PATH then a ValueFormatException is thrown.
If this property is currently part of the frozen state of a version in version storage, this method will throw a ValueFormatException.
the referenced property
ValueFormatException if this property cannot be converted to a PATH, if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage.
ItemNotFoundException If no property accessible by the current Session exists in this workspace at the specified path. Note that this applies even if a node exists at the specified location. To dereference to a target node, the method Property.getNode is used.
RepositoryException if another error occurs.
JCR 2.0
Returns a String representation of the value of this property. A shortcut for Property.getValue().getString().
A string representation of the value of this property.
ValueFormatException if conversion to a String is not possible or if the property is multi-valued.
RepositoryException if another error occurs.
Value
Returns the type of this Property. One of: PropertyType.STRING PropertyType.BINARY PropertyType.DATE PropertyType.DOUBLE PropertyType.LONG PropertyType.BOOLEAN PropertyType.NAME PropertyType.PATH PropertyType.REFERENCE PropertyType.WEAKREFERENCE PropertyType.URI The type returned is that which was set at property creation. Note that for some property p, the type returned by p.getType() will differ from the type returned by p.getDefinition.getRequiredType() only in the case where the latter returns UNDEFINED. The type of a property instance is never UNDEFINED (it must always have some actual type).
an int
RepositoryException if an error occurs
Returns an array of all the values of this property. Used to access multi-value properties. The array returned is a copy of the stored values, so changes to it are not reflected in internal storage.
a Value array.
ValueFormatException if the property is single-valued.
RepositoryException if another error occurs.
Returns true if this Item has been saved but has subsequently been modified through the current session and therefore the state of this item as recorded in the session differs from the state of this item as saved. Within a transaction, isModified on an Item may return false (because the Item has been saved since the modification) even if the modification in question is not in persistent storage (because the transaction has not yet been committed).
Note that in read-only implementations, this method will always return false.
true if this item is modified; false otherwise.
Returns true if this is a new item, meaning that it exists only in transient storage on the Session and has not yet been saved. Within a transaction, isNew on an Item may return false (because the item has been saved) even if that Item is not in persistent storage (because the transaction has not yet been committed).
Note that if an item returns true on isNew, then by definition is parent will return true on isModified.
Note that in read-only implementations, this method will always return false.
true if this item is new; false otherwise.
Returns true if this Item object (the Java object instance) represents the same actual workspace item as the object otherItem.
Two Item objects represent the same workspace item if and only if all the following are true: Both objects were acquired through Session objects that were created by the same Repository object. Both objects were acquired through Session objects bound to the same repository workspace. The objects are either both Node objects or both Property objects. If they are Node objects, they have the same identifier. If they are Property objects they have identical names and isSame is true of their parent nodes. This method does not compare the states of the two items. For example, if two Item objects representing the same actual workspace item have been retrieved through two different sessions and one has been modified, then this method will still return true when comparing these two objects. Note that if two Item objects representing the same workspace item are retrieved through the same session they will always reflect the same state.
the Item object to be tested for identity with this Item.
true if this Item object and otherItem represent the same actual repository item; false otherwise.
RepositoryException if an error occurs.
A Property object represents the smallest granularity of content storage. It has a single parent node and no children. A property consists of a name and a value, or in the case of multi-value properties, a set of values all of the same type. See Value.