Class EffectiveNodeType

  • All Implemented Interfaces:
    Cloneable

    public class EffectiveNodeType
    extends Object
    implements Cloneable
    An EffectiveNodeType represents one or more NodeTypes as one 'effective' node type where inheritance is resolved.

    Instances of EffectiveNodeType are immutable.

    • Method Detail

      • hasOrderableChildNodes

        public boolean hasOrderableChildNodes()
        Returns true if any of the included node types supports 'orderable child nodes'; returns false otherwise.
        Returns:
        true if this effective node type has orderable child nodes
      • getPrimaryItemName

        public org.apache.jackrabbit.spi.Name getPrimaryItemName()
      • getMergedNodeTypes

        public org.apache.jackrabbit.spi.Name[] getMergedNodeTypes()
      • getInheritedNodeTypes

        public org.apache.jackrabbit.spi.Name[] getInheritedNodeTypes()
      • getAllNodeTypes

        public org.apache.jackrabbit.spi.Name[] getAllNodeTypes()
      • getAllItemDefs

        public org.apache.jackrabbit.spi.QItemDefinition[] getAllItemDefs()
      • getNamedItemDefs

        public org.apache.jackrabbit.spi.QItemDefinition[] getNamedItemDefs()
      • getUnnamedItemDefs

        public org.apache.jackrabbit.spi.QItemDefinition[] getUnnamedItemDefs()
      • hasNamedItemDef

        public boolean hasNamedItemDef​(org.apache.jackrabbit.spi.Name name)
      • getNamedItemDefs

        public org.apache.jackrabbit.spi.QItemDefinition[] getNamedItemDefs​(org.apache.jackrabbit.spi.Name name)
      • getAllNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getAllNodeDefs()
      • getNamedNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getNamedNodeDefs()
      • getNamedNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getNamedNodeDefs​(org.apache.jackrabbit.spi.Name name)
      • getUnnamedNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getUnnamedNodeDefs()
      • getAutoCreateNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getAutoCreateNodeDefs()
      • getAllPropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getAllPropDefs()
      • getNamedPropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getNamedPropDefs()
      • getNamedPropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getNamedPropDefs​(org.apache.jackrabbit.spi.Name name)
      • getUnnamedPropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getUnnamedPropDefs()
      • getAutoCreatePropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getAutoCreatePropDefs()
      • getMandatoryPropDefs

        public org.apache.jackrabbit.spi.QPropertyDefinition[] getMandatoryPropDefs()
      • getMandatoryNodeDefs

        public org.apache.jackrabbit.spi.QNodeDefinition[] getMandatoryNodeDefs()
      • includesNodeType

        public boolean includesNodeType​(org.apache.jackrabbit.spi.Name nodeTypeName)
        Determines whether this effective node type representation includes (either through inheritance or aggregation) the given node type.
        Parameters:
        nodeTypeName - name of node type
        Returns:
        true if the given node type is included, otherwise false
      • includesNodeTypes

        public boolean includesNodeTypes​(org.apache.jackrabbit.spi.Name[] nodeTypeNames)
        Determines whether this effective node type representation includes (either through inheritance or aggregation) all of the given node types.
        Parameters:
        nodeTypeNames - array of node type names
        Returns:
        true if all of the given node types are included, otherwise false
      • checkSetPropertyValueConstraints

        public static void checkSetPropertyValueConstraints​(org.apache.jackrabbit.spi.QPropertyDefinition pd,
                                                            InternalValue[] values)
                                                     throws ConstraintViolationException,
                                                            RepositoryException
        Tests if the value constraints defined in the property definition pd are satisfied by the the specified values.

        Note that the protected flag is not checked. Also note that no type conversions are attempted if the type of the given values does not match the required type as specified in the given definition.

        Parameters:
        pd - The definiton of the property
        values - An array of InternalValue objects.
        Throws:
        ConstraintViolationException - if the value constraints defined in the property definition are satisfied by the the specified values
        RepositoryException - if another error occurs
      • getApplicableChildNodeDef

        public org.apache.jackrabbit.spi.QNodeDefinition getApplicableChildNodeDef​(org.apache.jackrabbit.spi.Name name,
                                                                                   org.apache.jackrabbit.spi.Name nodeTypeName,
                                                                                   NodeTypeRegistry ntReg)
                                                                            throws NoSuchNodeTypeException,
                                                                                   ConstraintViolationException
        Returns the applicable child node definition for a child node with the specified name and node type. If there are multiple applicable definitions named definitions will take precedence over residual definitions.
        Parameters:
        name -
        nodeTypeName -
        ntReg -
        Returns:
        Throws:
        NoSuchNodeTypeException
        ConstraintViolationException - if no applicable child node definition could be found
      • getApplicablePropertyDef

        public org.apache.jackrabbit.spi.QPropertyDefinition getApplicablePropertyDef​(org.apache.jackrabbit.spi.Name name,
                                                                                      int type,
                                                                                      boolean multiValued)
                                                                               throws ConstraintViolationException
        Returns the applicable property definition for a property with the specified name, type and multiValued characteristic. If there are multiple applicable definitions the following rules will be applied:
        • named definitions are preferred to residual definitions
        • definitions with specific required type are preferred to definitions with required type UNDEFINED
        Parameters:
        name -
        type -
        multiValued -
        Returns:
        Throws:
        ConstraintViolationException - if no applicable property definition could be found
      • getApplicablePropertyDef

        public org.apache.jackrabbit.spi.QPropertyDefinition getApplicablePropertyDef​(org.apache.jackrabbit.spi.Name name,
                                                                                      int type)
                                                                               throws ConstraintViolationException
        Returns the applicable property definition for a property with the specified name and type. The multiValued flag is not taken into account in the selection algorithm. Other than getApplicablePropertyDef(Name, int, boolean) this method does not take the multiValued flag into account in the selection algorithm. If there more than one applicable definitions then the following rules are applied:
        • named definitions are preferred to residual definitions
        • definitions with specific required type are preferred to definitions with required type UNDEFINED
        • single-value definitions are preferred to multiple-value definitions
        Parameters:
        name -
        type -
        Returns:
        Throws:
        ConstraintViolationException - if no applicable property definition could be found