Class AbstractProperty

    • Constructor Detail

      • AbstractProperty

        public AbstractProperty()
    • Method Detail

      • getPath

        public java.lang.String getPath()
                                 throws RepositoryException
        Returns the path of this property.

        The default implementation constructs the path from the path of the parent node and the name of this property.

        Specified by:
        getPath in interface Item
        Returns:
        property path
        Throws:
        RepositoryException - if an error occurs
      • isNode

        public boolean isNode()
        Returns false.
        Specified by:
        isNode in interface Item
        Returns:
        false
      • getNode

        public Node getNode()
                     throws ValueFormatException,
                            RepositoryException
        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.

        Specified by:
        getNode in interface Property
        Returns:
        the referenced Node
        Throws:
        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.
      • getProperty

        public Property getProperty()
                             throws RepositoryException
        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.

        Specified by:
        getProperty in interface Property
        Returns:
        the referenced property
        Throws:
        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.