Class QNodeTypeDefinitionImpl

java.lang.Object
org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl
All Implemented Interfaces:
Serializable, QNodeTypeDefinition

public class QNodeTypeDefinitionImpl extends Object implements QNodeTypeDefinition, Serializable
QNodeTypeDefinitionImpl implements a serializable SPI node type definition.
See Also:
  • Constructor Details

    • QNodeTypeDefinitionImpl

      public QNodeTypeDefinitionImpl()
      Default constructor.
    • QNodeTypeDefinitionImpl

      public QNodeTypeDefinitionImpl(QNodeTypeDefinition nt)
      Copy constructor.
      Parameters:
      nt - the node type definition.
    • QNodeTypeDefinitionImpl

      public QNodeTypeDefinitionImpl(Name name, Name[] supertypes, Name[] supportedMixins, boolean isMixin, boolean isAbstract, boolean isQueryable, boolean hasOrderableChildNodes, Name primaryItemName, QPropertyDefinition[] declaredPropDefs, QNodeDefinition[] declaredNodeDefs)
      Creates a new serializable SPI node type definition.
      Parameters:
      name - the name of the node type
      supertypes - the names of the supertypes
      supportedMixins - the names of supported mixins (or null)
      isMixin - if this is a mixin node type
      isAbstract - if this is an abstract node type definition.
      isQueryable - if this is a queryable node type definition.
      hasOrderableChildNodes - if this node type has orderable child nodes.
      primaryItemName - the name of the primary item, or null.
      declaredPropDefs - the declared property definitions.
      declaredNodeDefs - the declared child node definitions.
    • QNodeTypeDefinitionImpl

      public QNodeTypeDefinitionImpl(NodeTypeDefinition def, NamePathResolver resolver, QValueFactory qValueFactory) throws RepositoryException
      Create a a new QNodeTypeDefinitionImpl from a JCR NodeType definition.
      Parameters:
      def - node type definition
      resolver - resolver
      qValueFactory - value factory
      Throws:
      RepositoryException - if an error occurs
  • Method Details

    • getName

      public Name getName()
      Returns the name of the node type being defined or null if not set.
      Specified by:
      getName in interface QNodeTypeDefinition
      Returns:
      the name of the node type or null if not set.
    • getSupertypes

      public Name[] getSupertypes()
      Returns an array containing the names of the supertypes. If no supertypes have been specified, then an empty array is returned for mixin types and the nt:base primary type and an array containing just nt:base for other primary types.

      The returned array must not be modified by the application.

      Specified by:
      getSupertypes in interface QNodeTypeDefinition
      Returns:
      an array of supertype names
    • isMixin

      public boolean isMixin()
      Returns the value of the mixin flag.
      Specified by:
      isMixin in interface QNodeTypeDefinition
      Returns:
      true if this is a mixin node type; false otherwise.
    • isAbstract

      public boolean isAbstract()
      Returns true if the definition is abstract; false otherwise.
      Specified by:
      isAbstract in interface QNodeTypeDefinition
      Returns:
      true if the definition is abstract; false otherwise.
    • isQueryable

      public boolean isQueryable()
      Returns true if the definition is queryable; false otherwise.
      Specified by:
      isQueryable in interface QNodeTypeDefinition
      Returns:
      true if the definition is queryable; false otherwise.
    • hasOrderableChildNodes

      public boolean hasOrderableChildNodes()
      Returns the value of the orderableChildNodes flag.
      Specified by:
      hasOrderableChildNodes in interface QNodeTypeDefinition
      Returns:
      true if nodes of this node type can have orderable child nodes; false otherwise.
    • getPrimaryItemName

      public Name getPrimaryItemName()
      Returns the name of the primary item (one of the child items of the node's of this node type) or null if not set.
      Specified by:
      getPrimaryItemName in interface QNodeTypeDefinition
      Returns:
      the name of the primary item or null if not set.
    • getPropertyDefs

      public QPropertyDefinition[] getPropertyDefs()
      Returns an array containing the property definitions.
      Specified by:
      getPropertyDefs in interface QNodeTypeDefinition
      Returns:
      an array containing the property definitions.
    • getChildNodeDefs

      public QNodeDefinition[] getChildNodeDefs()
      Returns an array containing the child node definitions.
      Specified by:
      getChildNodeDefs in interface QNodeTypeDefinition
      Returns:
      an array containing the child node definitions.
    • getDependencies

      public Collection<Name> getDependencies()
      Returns a collection of node type Names that are being referenced by this node type definition (e.g. as supertypes, as required/default primary types in child node definitions, as REFERENCE value constraints in property definitions).

      Note that self-references (e.g. a child node definition that specifies the declaring node type as the default primary type) are not considered dependencies.

      Specified by:
      getDependencies in interface QNodeTypeDefinition
      Returns:
      a collection of node type Names
    • getSupportedMixinTypes

      public Name[] getSupportedMixinTypes()
      Returns an array containing the names of additional mixin types supported on this node type.

      The returned array must not be modified by the application.

      Specified by:
      getSupportedMixinTypes in interface QNodeTypeDefinition
      Returns:
      an array of mixin type names, or null when there are no known constraints.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.
      Overrides:
      hashCode in class Object
      Returns:
      always zero
      See Also: