Class NodeState


  • public class NodeState
    extends ItemState
    NodeState represents the state of a Node.
    • Method Detail

      • isNode

        public final boolean isNode()
        Determines if this item state represents a node.
        Specified by:
        isNode in class ItemState
        Returns:
        always true
        See Also:
        ItemState.isNode()
      • merge

        public ItemState.MergeResult merge​(ItemState another,
                                           boolean keepChanges)
        Description copied from class: ItemState
        Merge all data from the given state into this state. If 'keepChanges' is true, transient modifications present on this state are not touched. Otherwise this state is completely reset according to the given other state.
        Specified by:
        merge in class ItemState
        Returns:
        a MergeResult instance which represent the result of the merge operation
        See Also:
        ItemState.merge(ItemState, boolean)
      • revert

        public boolean revert()
        Description copied from class: ItemState
        Revert all transient modifications made to this ItemState.
        Specified by:
        revert in class ItemState
        Returns:
        Always returns false unless the definition has been modified along with a move operation.
        See Also:
        ItemState.revert()
      • getNodeEntry

        public NodeEntry getNodeEntry()
        Returns:
        The NodeEntry associated with this state.
      • getUniqueID

        public String getUniqueID()
        Returns:
        the unique ID of this node state or null if this node cannot be identified with a unique ID.
      • isRoot

        public boolean isRoot()
        Returns true, if this NodeState represent the root node.
        Returns:
        true if this NodeState represent the root node.
      • getNodeTypeName

        public Name getNodeTypeName()
        Returns the name of this node's node type.
        Returns:
        the name of this node's node type.
      • getMixinTypeNames

        public Name[] getMixinTypeNames()
        Returns the names of this node's mixin types.
        Returns:
        a set of the names of this node's mixin types.
      • setMixinTypeNames

        public void setMixinTypeNames​(Name[] mixinTypeNames)
        Used by NodeEntryImpl and NodeState only
        Parameters:
        mixinTypeNames -
      • getNodeTypeNames

        public Name[] getNodeTypeNames()
        Return all nodetype names that are defined to this NodeState including the primary nodetype and the mixins.
        Returns:
        array of NodeType names
      • getAllNodeTypeNames

        public Name[] getAllNodeTypeNames()
        TODO: clarify usage In case the status of the given node state is not Status.EXISTING the transiently added mixin types are taken into account as well.
        Returns:
      • hasDefinition

        public boolean hasDefinition()
                              throws RepositoryException
        Returns true if the definition of this state has already been calculated. False otherwise.
        Returns:
        true if definition has already been calculated.
        Throws:
        RepositoryException
      • getNodeReferences

        public Iterator<PropertyId> getNodeReferences​(Name propertyName,
                                                      boolean weak)
        Returns the identifiers of all reference properties that point to this node.
        Parameters:
        propertyName - name filter of referring properties to be returned; if null then all references are returned.
        weak - Boolean flag indicating whether weak references should be returned or not.
        Returns:
        reference property identifiers
      • hasChildNodeEntry

        public boolean hasChildNodeEntry​(Name name,
                                         int index)
        Utility Determines if there is a valid NodeEntry with the specified name and index.
        Parameters:
        name - Name object specifying a node name.
        index - 1-based index if there are same-name child node entries.
        Returns:
        true if there is a NodeEntry with the specified name and index.
      • getChildNodeState

        public NodeState getChildNodeState​(Name nodeName,
                                           int index)
                                    throws ItemNotFoundException,
                                           RepositoryException
        Utility Returns the child NodeState with the specified name and index. Throws ItemNotFoundException if there's no matching, valid entry.
        Parameters:
        nodeName - Name object specifying a node name.
        index - 1-based index if there are same-name child node entries.
        Returns:
        The NodeState with the specified name and index
        Throws:
        ItemNotFoundException
        RepositoryException
      • hasPropertyName

        public boolean hasPropertyName​(Name propName)
        Utility
        Parameters:
        propName - Name object specifying a property name
        Returns:
        true if there is a valid property entry with the specified Name.