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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QNodeTypeDefinitionImpl()
Default constructor.QNodeTypeDefinitionImpl(NodeTypeDefinition def, NamePathResolver resolver, QValueFactory qValueFactory)
Create a a newQNodeTypeDefinitionImpl
from 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 boolean
equals(Object obj)
QNodeDefinition[]
getChildNodeDefs()
Returns an array containing the child node definitions.Collection<Name>
getDependencies()
Returns a collection of node typeName
s that are being referenced by this node type definition (e.g.Name
getName()
Returns the name of the node type being defined ornull
if not set.Name
getPrimaryItemName()
Returns the name of the primary item (one of the child items of the node's of this node type) ornull
if 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.int
hashCode()
Returns zero to satisfy the Object equals/hashCode contract.boolean
hasOrderableChildNodes()
Returns the value of the orderableChildNodes flag.boolean
isAbstract()
Returnstrue
if the definition is abstract;false
otherwise.boolean
isMixin()
Returns the value of the mixin flag.boolean
isQueryable()
Returnstrue
if the definition is queryable;false
otherwise.
-
-
-
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 newQNodeTypeDefinitionImpl
from 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 ornull
if not set.- Specified by:
getName
in interfaceQNodeTypeDefinition
- 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 thent:base
primary type and an array containing justnt:base
for other primary types.The returned array must not be modified by the application.
- Specified by:
getSupertypes
in interfaceQNodeTypeDefinition
- Returns:
- an array of supertype names
-
isMixin
public boolean isMixin()
Returns the value of the mixin flag.- Specified by:
isMixin
in interfaceQNodeTypeDefinition
- Returns:
- true if this is a mixin node type; false otherwise.
-
isAbstract
public boolean isAbstract()
Returnstrue
if the definition is abstract;false
otherwise.- Specified by:
isAbstract
in interfaceQNodeTypeDefinition
- Returns:
true
if the definition is abstract;false
otherwise.
-
isQueryable
public boolean isQueryable()
Returnstrue
if the definition is queryable;false
otherwise.- Specified by:
isQueryable
in interfaceQNodeTypeDefinition
- Returns:
true
if the definition is queryable;false
otherwise.
-
hasOrderableChildNodes
public boolean hasOrderableChildNodes()
Returns the value of the orderableChildNodes flag.- Specified by:
hasOrderableChildNodes
in 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) ornull
if not set.- Specified by:
getPrimaryItemName
in interfaceQNodeTypeDefinition
- 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 interfaceQNodeTypeDefinition
- Returns:
- an array containing the property definitions.
-
getChildNodeDefs
public QNodeDefinition[] getChildNodeDefs()
Returns an array containing the child node definitions.- Specified by:
getChildNodeDefs
in interfaceQNodeTypeDefinition
- Returns:
- an array containing the child node definitions.
-
getDependencies
public Collection<Name> getDependencies()
Returns a collection of node typeName
s 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 interfaceQNodeTypeDefinition
- Returns:
- a collection of node type
Name
s
-
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 interfaceQNodeTypeDefinition
- Returns:
- an array of mixin type names, or
null
when there are no known constraints.
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in 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:
hashCode
in classObject
- Returns:
- always zero
- See Also:
Object.hashCode()
-
-