6.7.18 Discovery of Constraints on Existing Items

The Node and Property interfaces also have methods that allow direct access to the NodeDefinition or PropertyDefinition applicable to a particular node or property.

javax.jcr.
Node

NodeDefinition

getDefinition()

Returns the node definition that applies to this Node. In some cases there may appear to be more than one definition that could apply to this node. However, it is assumed that upon creation of this node, a single particular definition was used and it is that definition that this method returns. How this governing definition is selected upon node creation from among others which may have been applicable is an implementation issue and is not covered by this specification. The NodeDefinition returned when this method is called on the root node of a workspace is also up to the implementation.

Throws a RepositoryException if an error occurs.



javax.jcr.
Property

PropertyDefinition

getDefinition()

Returns the property definition that applies to this Property. In some cases there may appear to be more than one definition that could apply to this property. However, it is assumed that upon creation of this property, a single particular definition was used and it is that definition that this method returns. How this governing definition is selected upon property creation from among others which may have been applicable is an implementation issue and is not covered by this specification.

Throws a RepositoryException if an error occurs.