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 Name getPrimaryItemName()
      • getMergedNodeTypes

        public Name[] getMergedNodeTypes()
      • getInheritedNodeTypes

        public Name[] getInheritedNodeTypes()
      • getAllNodeTypes

        public Name[] getAllNodeTypes()
      • hasNamedItemDef

        public boolean hasNamedItemDef​(Name name)
      • includesNodeType

        public boolean includesNodeType​(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​(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​(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
      • getApplicablePropertyDef

        public QPropertyDefinition getApplicablePropertyDef​(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 QPropertyDefinition getApplicablePropertyDef​(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