Class NodeTypeImpl
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeType
-
- org.apache.jackrabbit.core.nodetype.NodeTypeImpl
-
- All Implemented Interfaces:
NodeType
,NodeTypeDefinition
public class NodeTypeImpl extends AbstractNodeType implements NodeType, NodeTypeDefinition
ANodeTypeImpl
...
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeType
ntd, resolver
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAddChildNode(String childNodeName)
boolean
canAddChildNode(String childNodeName, String nodeTypeName)
boolean
canRemoveItem(String itemName)
boolean
canRemoveNode(String nodeName)
Returnstrue
if removing the child node callednodeName
is allowed by this node type.boolean
canRemoveProperty(String propertyName)
Returnstrue
if removing the property calledpropertyName
is allowed by this node type.boolean
canSetProperty(String propertyName, Value value)
boolean
canSetProperty(String propertyName, Value[] values)
NodeDefinition[]
getAutoCreatedNodeDefinitions()
Returns an array containing only those child node definitions of this node type (including the child node definitions inherited from supertypes of this node type) where
returnsItemDefinition.isAutoCreated()
true
.PropertyDefinition[]
getAutoCreatedPropertyDefinitions()
Returns an array containing only those property definitions of this node type (including the property definitions inherited from supertypes of this node type) where
returnsItemDefinition.isAutoCreated()
true
.NodeDefinition[]
getChildNodeDefinitions()
NodeType[]
getInheritedSupertypes()
Returns all inherited supertypes of this node type.NodeDefinition[]
getMandatoryNodeDefinitions()
Returns an array containing only those child node definitions of this node type (including the child node definitions inherited from supertypes of this node type) where
returnsItemDefinition.isMandatory()
true
.PropertyDefinition[]
getMandatoryPropertyDefinitions()
Returns an array containing only those property definitions of this node type (including the property definitions inherited from supertypes of this node type) where
returnsItemDefinition.isMandatory()
true
.PropertyDefinition[]
getPropertyDefinitions()
Name
getQName()
Returns theName
of this node type.NodeType[]
getSupertypes()
boolean
hasOrderableChildNodes()
boolean
isDerivedFrom(Name nodeTypeName)
Checks if this node type is directly or indirectly derived from the specified node type.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.-
Methods inherited from class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeType
getDeclaredChildNodeDefinitions, getDeclaredPropertyDefinitions, getDeclaredSubtypes, getDeclaredSupertypeNames, getDeclaredSupertypes, getDefinition, getName, getPrimaryItemName, getSubtypes, getSubtypes, isAbstract, isMixin, isNodeType, isQueryable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.nodetype.NodeType
getDeclaredSubtypes, getDeclaredSupertypes, getSubtypes, isNodeType
-
Methods inherited from interface javax.jcr.nodetype.NodeTypeDefinition
getDeclaredChildNodeDefinitions, getDeclaredPropertyDefinitions, getDeclaredSupertypeNames, getName, getPrimaryItemName, isAbstract, isMixin, isQueryable
-
-
-
-
Method Detail
-
isNodeType
public 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.- Specified by:
isNodeType
in classAbstractNodeType
- 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
.
-
isDerivedFrom
public boolean isDerivedFrom(Name nodeTypeName)
Checks if this node type is directly or indirectly derived from the specified node type.- Parameters:
nodeTypeName
- the name of a node type.- Returns:
- true if this node type is directly or indirectly derived from the specified node type, otherwise false.
-
getAutoCreatedNodeDefinitions
public NodeDefinition[] getAutoCreatedNodeDefinitions()
Returns an array containing only those child node definitions of this node type (including the child node definitions inherited from supertypes of this node type) where
returnsItemDefinition.isAutoCreated()
true
.- Returns:
- an array of child node definitions.
- See Also:
ItemDefinition.isAutoCreated()
-
getAutoCreatedPropertyDefinitions
public PropertyDefinition[] getAutoCreatedPropertyDefinitions()
Returns an array containing only those property definitions of this node type (including the property definitions inherited from supertypes of this node type) where
returnsItemDefinition.isAutoCreated()
true
.- Returns:
- an array of property definitions.
- See Also:
ItemDefinition.isAutoCreated()
-
getMandatoryPropertyDefinitions
public PropertyDefinition[] getMandatoryPropertyDefinitions()
Returns an array containing only those property definitions of this node type (including the property definitions inherited from supertypes of this node type) where
returnsItemDefinition.isMandatory()
true
.- Returns:
- an array of property definitions.
- See Also:
ItemDefinition.isMandatory()
-
getMandatoryNodeDefinitions
public NodeDefinition[] getMandatoryNodeDefinitions()
Returns an array containing only those child node definitions of this node type (including the child node definitions inherited from supertypes of this node type) where
returnsItemDefinition.isMandatory()
true
.- Returns:
- an array of child node definitions.
- See Also:
ItemDefinition.isMandatory()
-
getQName
public Name getQName()
Returns theName
of this node type.- Returns:
- the name
-
getInheritedSupertypes
public NodeType[] getInheritedSupertypes()
Returns all inherited supertypes of this node type.- Returns:
- an array of
NodeType
objects. - See Also:
getSupertypes()
,AbstractNodeType.getDeclaredSupertypes()
-
hasOrderableChildNodes
public boolean hasOrderableChildNodes()
- Specified by:
hasOrderableChildNodes
in interfaceNodeTypeDefinition
-
getSupertypes
public NodeType[] getSupertypes()
- Specified by:
getSupertypes
in interfaceNodeType
-
getChildNodeDefinitions
public NodeDefinition[] getChildNodeDefinitions()
- Specified by:
getChildNodeDefinitions
in interfaceNodeType
-
getPropertyDefinitions
public PropertyDefinition[] getPropertyDefinitions()
- Specified by:
getPropertyDefinitions
in interfaceNodeType
-
canSetProperty
public boolean canSetProperty(String propertyName, Value value)
- Specified by:
canSetProperty
in interfaceNodeType
-
canSetProperty
public boolean canSetProperty(String propertyName, Value[] values)
- Specified by:
canSetProperty
in interfaceNodeType
-
canAddChildNode
public boolean canAddChildNode(String childNodeName)
- Specified by:
canAddChildNode
in interfaceNodeType
-
canAddChildNode
public boolean canAddChildNode(String childNodeName, String nodeTypeName)
- Specified by:
canAddChildNode
in interfaceNodeType
-
canRemoveItem
public boolean canRemoveItem(String itemName)
- Specified by:
canRemoveItem
in interfaceNodeType
-
canRemoveNode
public boolean canRemoveNode(String nodeName)
Returnstrue
if removing the child node callednodeName
is allowed by this node type. Returnsfalse
otherwise.- Specified by:
canRemoveNode
in interfaceNodeType
- Parameters:
nodeName
- The name of the child node- Returns:
- a boolean
- Since:
- JCR 2.0
-
canRemoveProperty
public boolean canRemoveProperty(String propertyName)
Returnstrue
if removing the property calledpropertyName
is allowed by this node type. Returnsfalse
otherwise.- Specified by:
canRemoveProperty
in interfaceNodeType
- Parameters:
propertyName
- The name of the property- Returns:
- a boolean
- Since:
- JCR 2.0
-
-