Class AbstractNodeType
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeType
-
- All Implemented Interfaces:
NodeType
,NodeTypeDefinition
public abstract class AbstractNodeType extends java.lang.Object implements NodeType
AbstractNodeType
...
-
-
Field Summary
-
Fields inherited from interface javax.jcr.nodetype.NodeType
MIX_CREATED, MIX_LANGUAGE, MIX_LAST_MODIFIED, MIX_LIFECYCLE, MIX_LOCKABLE, MIX_MIMETYPE, MIX_REFERENCEABLE, MIX_SHAREABLE, MIX_SIMPLE_VERSIONABLE, MIX_TITLE, MIX_VERSIONABLE, NT_ACTIVITY, NT_ADDRESS, NT_BASE, NT_CHILD_NODE_DEFINITION, NT_CONFIGURATION, NT_FILE, NT_FOLDER, NT_FROZEN_NODE, NT_HIERARCHY_NODE, NT_LINKED_FILE, NT_NODE_TYPE, NT_PROPERTY_DEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSION_HISTORY, NT_VERSIONED_CHILD
-
-
Constructor Summary
Constructors Constructor Description AbstractNodeType(QNodeTypeDefinition ntd, AbstractNodeTypeManager ntMgr, NamePathResolver resolver)
Create a newAbstractNodeType
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NodeDefinition[]
getDeclaredChildNodeDefinitions()
Returns an array containing the child node definitions actually declared in this node type.PropertyDefinition[]
getDeclaredPropertyDefinitions()
Returns an array containing the property definitions actually declared in this node type.NodeTypeIterator
getDeclaredSubtypes()
Returns the direct subtypes of this node type in the node type inheritance hierarchy, that is, those which actually declared this node type in their list of supertypes.java.lang.String[]
getDeclaredSupertypeNames()
Returns the names of the supertypes actually declared in this node type.NodeType[]
getDeclaredSupertypes()
Returns the direct supertypes of this node type in the node type inheritance hierarchy, that is, those actually declared in this node type.QNodeTypeDefinition
getDefinition()
Returns the node type definition.java.lang.String
getName()
Returns the name of the node type.java.lang.String
getPrimaryItemName()
Returns the name of the primary item (one of the child items of the nodes of this node type).NodeTypeIterator
getSubtypes()
Returns all subtypes of this node type in the node type inheritance hierarchy.NodeTypeIterator
getSubtypes(boolean directOnly)
Returns the node types derived from this node type.boolean
isAbstract()
Returnstrue
if this is an abstract node type; returnsfalse
otherwise.boolean
isMixin()
Returnstrue
if this is a mixin type; returnsfalse
if it is primary.boolean
isNodeType(java.lang.String nodeTypeName)
Returnstrue
if the name of this node type or any of its direct or indirect supertypes is equal tonodeTypeName
, otherwise returnsfalse
.abstract boolean
isNodeType(Name nodeTypeName)
Test if this nodetype equals or is directly or indirectly derived from the node type with the specifiednodeTypeName
, without checking of a node type of that name really exists.boolean
isQueryable()
Returnstrue
if the node type is queryable, meaning that the available-query-operators, full-text-searchable and query-orderable attributes of its property definitions take effect.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.nodetype.NodeType
canAddChildNode, canAddChildNode, canRemoveItem, canRemoveNode, canRemoveProperty, canSetProperty, canSetProperty, getChildNodeDefinitions, getPropertyDefinitions, getSupertypes
-
Methods inherited from interface javax.jcr.nodetype.NodeTypeDefinition
hasOrderableChildNodes
-
-
-
-
Constructor Detail
-
AbstractNodeType
public AbstractNodeType(QNodeTypeDefinition ntd, AbstractNodeTypeManager ntMgr, NamePathResolver resolver)
Create a newAbstractNodeType
.- Parameters:
ntd
- the underlying node type definition.ntMgr
- the node type manager.resolver
- the name/path resolver of the session that created this node type instance.
-
-
Method Detail
-
getDefinition
public QNodeTypeDefinition getDefinition()
Returns the node type definition.- Returns:
- the internal node type definition.
-
getName
public java.lang.String getName()
Returns the name of the node type.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnnull
.- Specified by:
getName
in interfaceNodeTypeDefinition
- Returns:
- a
String
-
isAbstract
public boolean isAbstract()
Returnstrue
if this is an abstract node type; returnsfalse
otherwise.An abstract node type is one that cannot be assigned as the primary or mixin type of a node but can be used in the definitions of other node types as a superclass.
In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnfalse
.- Specified by:
isAbstract
in interfaceNodeTypeDefinition
- Returns:
- a
boolean
-
isMixin
public boolean isMixin()
Returnstrue
if this is a mixin type; returnsfalse
if it is primary.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnfalse
.- Specified by:
isMixin
in interfaceNodeTypeDefinition
- Returns:
- a
boolean
-
isQueryable
public boolean isQueryable()
Returnstrue
if the node type is queryable, meaning that the available-query-operators, full-text-searchable and query-orderable attributes of its property definitions take effect. SeePropertyDefinition.getAvailableQueryOperators()
,PropertyDefinition.isFullTextSearchable()
andPropertyDefinition.isQueryOrderable()
.If a node type is declared non-queryable then these attributes of its property definitions have no effect.
In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will return an implementation-determined defalt value.- Specified by:
isQueryable
in interfaceNodeTypeDefinition
- Returns:
- a
boolean
-
getDeclaredSupertypeNames
public java.lang.String[] getDeclaredSupertypeNames()
Returns the names of the supertypes actually declared in this node type.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will return an empty array.- Specified by:
getDeclaredSupertypeNames
in interfaceNodeTypeDefinition
- Returns:
- an array of
String
s
-
getDeclaredSupertypes
public NodeType[] getDeclaredSupertypes()
Returns the direct supertypes of this node type in the node type inheritance hierarchy, that is, those actually declared in this node type. In single-inheritance systems, this will always be an array of size 0 or 1. In systems that support multiple inheritance of node types this array may be of size greater than 1.- Specified by:
getDeclaredSupertypes
in interfaceNodeType
- Returns:
- an array of
NodeType
objects. - See Also:
NodeType.getSupertypes()
-
getDeclaredSubtypes
public NodeTypeIterator getDeclaredSubtypes()
Description copied from interface:NodeType
Returns the direct subtypes of this node type in the node type inheritance hierarchy, that is, those which actually declared this node type in their list of supertypes.- Specified by:
getDeclaredSubtypes
in interfaceNodeType
- Returns:
- an
NodeTypeIterator
. - See Also:
NodeType.getDeclaredSubtypes()
-
getSubtypes
public NodeTypeIterator getSubtypes()
Description copied from interface:NodeType
Returns all subtypes of this node type in the node type inheritance hierarchy.- Specified by:
getSubtypes
in interfaceNodeType
- Returns:
- a
NodeTypeIterator
. - See Also:
NodeType.getSubtypes()
-
getDeclaredChildNodeDefinitions
public NodeDefinition[] getDeclaredChildNodeDefinitions()
Returns an array containing the child node definitions actually declared in this node type.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnnull
.- Specified by:
getDeclaredChildNodeDefinitions
in interfaceNodeTypeDefinition
- Returns:
- an array of
NodeDefinition
s
-
getPrimaryItemName
public java.lang.String getPrimaryItemName()
Returns the name of the primary item (one of the child items of the nodes of this node type). If this node has no primary item, then this method returnsnull
. This indicator is used by the methodNode.getPrimaryItem()
.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnnull
.- Specified by:
getPrimaryItemName
in interfaceNodeTypeDefinition
- Returns:
- a
String
-
getDeclaredPropertyDefinitions
public PropertyDefinition[] getDeclaredPropertyDefinitions()
Description copied from interface:NodeTypeDefinition
Returns an array containing the property definitions actually declared in this node type.In implementations that support node type registration, if this
NodeTypeDefinition
object is actually a newly-created emptyNodeTypeTemplate
, then this method will returnnull
.- Specified by:
getDeclaredPropertyDefinitions
in interfaceNodeTypeDefinition
- Returns:
- an array of
PropertyDefinition
s - See Also:
NodeTypeDefinition.getDeclaredPropertyDefinitions()
-
isNodeType
public boolean isNodeType(java.lang.String nodeTypeName)
Returnstrue
if the name of this node type or any of its direct or indirect supertypes is equal tonodeTypeName
, otherwise returnsfalse
.- Specified by:
isNodeType
in interfaceNodeType
- Parameters:
nodeTypeName
- the name of a node type.- Returns:
- a boolean
-
isNodeType
public abstract boolean isNodeType(Name nodeTypeName)
Test if this nodetype equals or is directly or indirectly derived from the node type with the specifiednodeTypeName
, without checking of a node type of that name really exists.- Parameters:
nodeTypeName
- A node type name.- Returns:
- true if this node type represents the type with the given
nodeTypeName
or if it is directly or indirectly derived from it; otherwisefalse
. If no node type exists with the specified name this method will also returnfalse
.
-
getSubtypes
public NodeTypeIterator getSubtypes(boolean directOnly)
Returns the node types derived from this node type.- Parameters:
directOnly
- iftrue
only direct subtypes will be considered- Returns:
- an
NodeTypeIterator
. - See Also:
NodeType.getSubtypes()
,NodeType.getDeclaredSubtypes()
-
-