Class QNodeTypeDefinitionImpl
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl
-
- All Implemented Interfaces:
Serializable,QNodeTypeDefinition
public class QNodeTypeDefinitionImpl extends Object implements QNodeTypeDefinition, Serializable
QNodeTypeDefinitionImplimplements a serializable SPI node type definition.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QNodeTypeDefinitionImpl()Default constructor.QNodeTypeDefinitionImpl(NodeTypeDefinition def, NamePathResolver resolver, QValueFactory qValueFactory)Create a a newQNodeTypeDefinitionImplfrom a JCR NodeType definition.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.QNodeTypeDefinitionImpl(QNodeTypeDefinition nt)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)QNodeDefinition[]getChildNodeDefs()Returns an array containing the child node definitions.Collection<Name>getDependencies()Returns a collection of node typeNames that are being referenced by this node type definition (e.g.NamegetName()Returns the name of the node type being defined ornullif not set.NamegetPrimaryItemName()Returns the name of the primary item (one of the child items of the node's of this node type) ornullif not set.QPropertyDefinition[]getPropertyDefs()Returns an array containing the property definitions.Name[]getSupertypes()Returns an array containing the names of the supertypes.Name[]getSupportedMixinTypes()Returns an array containing the names of additional mixin types supported on this node type.inthashCode()Returns zero to satisfy the Object equals/hashCode contract.booleanhasOrderableChildNodes()Returns the value of the orderableChildNodes flag.booleanisAbstract()Returnstrueif the definition is abstract;falseotherwise.booleanisMixin()Returns the value of the mixin flag.booleanisQueryable()Returnstrueif the definition is queryable;falseotherwise.
-
-
-
Constructor Detail
-
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 typesupertypes- the names of the supertypessupportedMixins- the names of supported mixins (ornull)isMixin- if this is a mixin node typeisAbstract- 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, ornull.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 newQNodeTypeDefinitionImplfrom a JCR NodeType definition.- Parameters:
def- node type definitionresolver- resolverqValueFactory- value factory- Throws:
RepositoryException- if an error occurs
-
-
Method Detail
-
getName
public Name getName()
Returns the name of the node type being defined ornullif not set.- Specified by:
getNamein interfaceQNodeTypeDefinition- Returns:
- the name of the node type or
nullif 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 thent:baseprimary type and an array containing justnt:basefor other primary types.The returned array must not be modified by the application.
- Specified by:
getSupertypesin interfaceQNodeTypeDefinition- Returns:
- an array of supertype names
-
isMixin
public boolean isMixin()
Returns the value of the mixin flag.- Specified by:
isMixinin interfaceQNodeTypeDefinition- Returns:
- true if this is a mixin node type; false otherwise.
-
isAbstract
public boolean isAbstract()
Returnstrueif the definition is abstract;falseotherwise.- Specified by:
isAbstractin interfaceQNodeTypeDefinition- Returns:
trueif the definition is abstract;falseotherwise.
-
isQueryable
public boolean isQueryable()
Returnstrueif the definition is queryable;falseotherwise.- Specified by:
isQueryablein interfaceQNodeTypeDefinition- Returns:
trueif the definition is queryable;falseotherwise.
-
hasOrderableChildNodes
public boolean hasOrderableChildNodes()
Returns the value of the orderableChildNodes flag.- Specified by:
hasOrderableChildNodesin interfaceQNodeTypeDefinition- 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) ornullif not set.- Specified by:
getPrimaryItemNamein interfaceQNodeTypeDefinition- Returns:
- the name of the primary item or
nullif not set.
-
getPropertyDefs
public QPropertyDefinition[] getPropertyDefs()
Returns an array containing the property definitions.- Specified by:
getPropertyDefsin interfaceQNodeTypeDefinition- Returns:
- an array containing the property definitions.
-
getChildNodeDefs
public QNodeDefinition[] getChildNodeDefs()
Returns an array containing the child node definitions.- Specified by:
getChildNodeDefsin interfaceQNodeTypeDefinition- Returns:
- an array containing the child node definitions.
-
getDependencies
public Collection<Name> getDependencies()
Returns a collection of node typeNames 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:
getDependenciesin interfaceQNodeTypeDefinition- 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:
getSupportedMixinTypesin interfaceQNodeTypeDefinition- Returns:
- an array of mixin type names, or
nullwhen there are no known constraints.
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(Object)
-
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:
hashCodein classObject- Returns:
- always zero
- See Also:
Object.hashCode()
-
-