org.apache.jackrabbit.core.nodetype
Class NodeDefinitionImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.nodetype.NodeDefinitionImpl
All Implemented Interfaces:
javax.jcr.nodetype.ItemDefinition, javax.jcr.nodetype.NodeDefinition

public class NodeDefinitionImpl
extends Object
implements javax.jcr.nodetype.NodeDefinition

This class implements the NodeDefinition interface. All method calls are delegated to the wrapped NodeDef, performing the translation from Names to JCR names (and vice versa) where necessary.


Field Summary
protected static String ANY_NAME
          Literal for 'any name'.
protected  ItemDef itemDef
          The wrapped item definition.
protected  NodeTypeManagerImpl ntMgr
          The node type manager of this session.
protected  NamePathResolver resolver
          The name/path resolver used to translate qualified names to JCR names.
 
Method Summary
 boolean allowsSameNameSiblings()
          
 boolean definesResidual()
          Checks whether this is a residual item definition.
 boolean equals(Object o)
          
 javax.jcr.nodetype.NodeType getDeclaringNodeType()
          
 javax.jcr.nodetype.NodeType getDefaultPrimaryType()
          
 String getDefaultPrimaryTypeName()
          Returns the name of the default primary node type.
 String getName()
          
 int getOnParentVersion()
          
 Name getQName()
          Gets the Name of the child item.
 String[] getRequiredPrimaryTypeNames()
          Returns the names of the required primary node types.
 javax.jcr.nodetype.NodeType[] getRequiredPrimaryTypes()
          
 int hashCode()
          
 boolean isAutoCreated()
          
 boolean isMandatory()
          
 boolean isProtected()
          
 NodeDef unwrap()
          Returns the wrapped node definition.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.nodetype.ItemDefinition
getDeclaringNodeType, getName, getOnParentVersion, isAutoCreated, isMandatory, isProtected
 

Field Detail

ANY_NAME

protected static final String ANY_NAME
Literal for 'any name'.

See Also:
Constant Field Values

ntMgr

protected final NodeTypeManagerImpl ntMgr
The node type manager of this session.


resolver

protected final NamePathResolver resolver
The name/path resolver used to translate qualified names to JCR names.


itemDef

protected final ItemDef itemDef
The wrapped item definition.

Method Detail

unwrap

public NodeDef unwrap()
Returns the wrapped node definition.

Returns:
the wrapped node definition.

getDefaultPrimaryType

public javax.jcr.nodetype.NodeType getDefaultPrimaryType()

Specified by:
getDefaultPrimaryType in interface javax.jcr.nodetype.NodeDefinition

getRequiredPrimaryTypes

public javax.jcr.nodetype.NodeType[] getRequiredPrimaryTypes()

Specified by:
getRequiredPrimaryTypes in interface javax.jcr.nodetype.NodeDefinition

allowsSameNameSiblings

public boolean allowsSameNameSiblings()

Specified by:
allowsSameNameSiblings in interface javax.jcr.nodetype.NodeDefinition

getRequiredPrimaryTypeNames

public String[] getRequiredPrimaryTypeNames()
Returns the names of the required primary node types.

If this NodeDefinition is acquired from a live NodeType this list will reflect the node types returned by getRequiredPrimaryTypes, above.

If this NodeDefinition is actually a NodeDefinitionTemplate that is not part of a registered node type, then this method will return the required primary types as set in that template. If that template is a newly-created empty one, then this method will return an array containing a single string indicating the node type nt:base.

Returns:
a String array
Since:
JCR 2.0

getDefaultPrimaryTypeName

public String getDefaultPrimaryTypeName()
Returns the name of the default primary node type.

If this NodeDefinition is acquired from a live NodeType this list will reflect the NodeType returned by getDefaultPrimaryType, above.

If this NodeDefinition is actually a NodeDefinitionTemplate that is not part of a registered node type, then this method will return the required primary types as set in that template. If that template is a newly-created empty one, then this method will return null.

Returns:
a String
Since:
JCR 2.0

definesResidual

public boolean definesResidual()
Checks whether this is a residual item definition.

Returns:
true if this is a residual item definition

getQName

public Name getQName()
Gets the Name of the child item. It is an error to call this method if this is a residual item definition.

Returns:
the Name of the child item.
See Also:
getName()

getDeclaringNodeType

public javax.jcr.nodetype.NodeType getDeclaringNodeType()

Specified by:
getDeclaringNodeType in interface javax.jcr.nodetype.ItemDefinition

getName

public String getName()

Specified by:
getName in interface javax.jcr.nodetype.ItemDefinition

getOnParentVersion

public int getOnParentVersion()

Specified by:
getOnParentVersion in interface javax.jcr.nodetype.ItemDefinition

isAutoCreated

public boolean isAutoCreated()

Specified by:
isAutoCreated in interface javax.jcr.nodetype.ItemDefinition

isMandatory

public boolean isMandatory()

Specified by:
isMandatory in interface javax.jcr.nodetype.ItemDefinition

isProtected

public boolean isProtected()

Specified by:
isProtected in interface javax.jcr.nodetype.ItemDefinition

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.