org.apache.jackrabbit.core.nodetype
Class NodeTypeImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.nodetype.NodeTypeImpl
All Implemented Interfaces:
NodeType, NodeTypeDefinition

public class NodeTypeImpl
extends Object
implements NodeType, NodeTypeDefinition

A NodeTypeImpl ...


Method Summary
 boolean canAddChildNode(String childNodeName)
          
 boolean canAddChildNode(String childNodeName, String nodeTypeName)
          
 boolean canRemoveItem(String itemName)
          
 boolean canRemoveNode(String nodeName)
          Returns true if removing the child node called nodeName is allowed by this node type.
 boolean canRemoveProperty(String propertyName)
          Returns true if removing the property called propertyName 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 ItemDefinition.isAutoCreated() returns 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 ItemDefinition.isAutoCreated() returns true.
 NodeDefinition[] getChildNodeDefinitions()
          
 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.
 String[] getDeclaredSupertypeNames()
          Returns the names of the supertypes actually declared in this node type.
 NodeType[] getDeclaredSupertypes()
          
 NodeTypeDef getDefinition()
          Returns the definition of this node type.
 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 ItemDefinition.isMandatory() returns 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 ItemDefinition.isMandatory() returns true.
 String getName()
          Returns the name of the node type.
 String getPrimaryItemName()
          Returns the name of the primary item (one of the child items of the nodes of this node type).
 PropertyDefinition[] getPropertyDefinitions()
          
 Name getQName()
          Returns the 'internal', i.e.
 NodeType[] getSupertypes()
          
 boolean hasOrderableChildNodes()
          Returns true if nodes of this type must support orderable child nodes; returns false otherwise.
 boolean isAbstract()
          Returns true if this is an abstract node type; returns false otherwise.
 boolean isDerivedFrom(Name nodeTypeName)
          Checks if this node type is directly or indirectly derived from the specified node type.
 boolean isMixin()
          Returns true if this is a mixin type; returns false if it is primary.
 boolean isNodeType(String nodeTypeName)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDerivedFrom

public boolean isDerivedFrom(Name nodeTypeName)
Checks if this node type is directly or indirectly derived from the specified node type.

Parameters:
nodeTypeName -
Returns:
true if this node type is directly or indirectly derived from the specified node type, otherwise false.

getDefinition

public NodeTypeDef getDefinition()
Returns the definition of this node type.

Returns:
the definition of this node type

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 ItemDefinition.isAutoCreated() returns 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 ItemDefinition.isAutoCreated() returns 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 ItemDefinition.isMandatory() returns 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 ItemDefinition.isMandatory() returns true.

Returns:
an array of child node definitions.
See Also:
ItemDefinition.isMandatory()

getQName

public Name getQName()
Returns the 'internal', i.e. the fully qualified name.

Returns:
the qualified name

getInheritedSupertypes

public NodeType[] getInheritedSupertypes()
Returns all inherited supertypes of this node type.

Returns:
an array of NodeType objects.
See Also:
getSupertypes(), getDeclaredSupertypes()

getName

public 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 empty NodeTypeTemplate, then this method will return null.

Specified by:
getName in interface NodeType
Specified by:
getName in interface NodeTypeDefinition
Returns:
a String

getDeclaredSupertypeNames

public 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 empty NodeTypeTemplate, then this method will return an array containing a single string indicating the node type nt:base.

Specified by:
getDeclaredSupertypeNames in interface NodeTypeDefinition
Returns:
an array of Strings
Since:
JCR 2.0

isAbstract

public boolean isAbstract()
Returns true if this is an abstract node type; returns false 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 empty NodeTypeTemplate, then this method will return false.

Specified by:
isAbstract in interface NodeTypeDefinition
Returns:
a boolean
Since:
JCR 2.0

isMixin

public boolean isMixin()
Returns true if this is a mixin type; returns false if it is primary.

In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.

Specified by:
isMixin in interface NodeType
Specified by:
isMixin in interface NodeTypeDefinition
Returns:
a boolean

hasOrderableChildNodes

public boolean hasOrderableChildNodes()
Returns true if nodes of this type must support orderable child nodes; returns false otherwise. If a node type returns true on a call to this method, then all nodes of that node type must support the method Node.orderBefore. If a node type returns false on a call to this method, then nodes of that node type may support Node.orderBefore. Only the primary node type of a node controls that node's status in this regard. This setting on a mixin node type will not have any effect on the node.

In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return false.

Specified by:
hasOrderableChildNodes in interface NodeType
Specified by:
hasOrderableChildNodes in interface NodeTypeDefinition
Returns:
a boolean

getPrimaryItemName

public 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 returns null. This indicator is used by the method Node.getPrimaryItem().

In implementations that support node type registration, if this NodeTypeDefinition object is actually a newly-created empty NodeTypeTemplate, then this method will return null.

Specified by:
getPrimaryItemName in interface NodeType
Specified by:
getPrimaryItemName in interface NodeTypeDefinition
Returns:
a String

getDeclaredSupertypes

public NodeType[] getDeclaredSupertypes()

Specified by:
getDeclaredSupertypes in interface NodeType

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 empty NodeTypeTemplate, then this method will return null.

Specified by:
getDeclaredChildNodeDefinitions in interface NodeType
Specified by:
getDeclaredChildNodeDefinitions in interface NodeTypeDefinition
Returns:
an array of NodeDefinitions

isNodeType

public boolean isNodeType(String nodeTypeName)

Specified by:
isNodeType in interface NodeType

getSupertypes

public NodeType[] getSupertypes()

Specified by:
getSupertypes in interface NodeType

getChildNodeDefinitions

public NodeDefinition[] getChildNodeDefinitions()

Specified by:
getChildNodeDefinitions in interface NodeType

getPropertyDefinitions

public PropertyDefinition[] getPropertyDefinitions()

Specified by:
getPropertyDefinitions in interface NodeType

canSetProperty

public boolean canSetProperty(String propertyName,
                              Value value)

Specified by:
canSetProperty in interface NodeType

canSetProperty

public boolean canSetProperty(String propertyName,
                              Value[] values)

Specified by:
canSetProperty in interface NodeType

canAddChildNode

public boolean canAddChildNode(String childNodeName)

Specified by:
canAddChildNode in interface NodeType

canAddChildNode

public boolean canAddChildNode(String childNodeName,
                               String nodeTypeName)

Specified by:
canAddChildNode in interface NodeType

canRemoveItem

public boolean canRemoveItem(String itemName)

Specified by:
canRemoveItem in interface NodeType

getDeclaredPropertyDefinitions

public PropertyDefinition[] getDeclaredPropertyDefinitions()
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 empty NodeTypeTemplate, then this method will return null.

Specified by:
getDeclaredPropertyDefinitions in interface NodeType
Specified by:
getDeclaredPropertyDefinitions in interface NodeTypeDefinition
Returns:
an array of PropertyDefinitions

canRemoveNode

public boolean canRemoveNode(String nodeName)
Returns true if removing the child node called nodeName is allowed by this node type. Returns false otherwise.

Parameters:
nodeName - The name of the child node
Returns:
a boolean
Since:
JCR 2.0

canRemoveProperty

public boolean canRemoveProperty(String propertyName)
Returns true if removing the property called propertyName is allowed by this node type. Returns false otherwise.

Parameters:
propertyName - The name of the property
Returns:
a boolean
Since:
JCR 2.0


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.