org.apache.jackrabbit.spi.commons.nodetype
Class NodeDefinitionImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl
All Implemented Interfaces:
ItemDefinition, NodeDefinition

public class NodeDefinitionImpl
extends Object
implements NodeDefinition

This class implements the NodeDefinition interface. All method calls are delegated to the wrapped QNodeDefinition, performing the translation from Names to JCR names where necessary.


Field Summary
protected static String ANY_NAME
          Literal for 'any name'.
protected  QItemDefinition itemDef
          The wrapped item definition.
protected  AbstractNodeTypeManager ntMgr
          The node type manager of this session.
protected  NamePathResolver resolver
          The namespace resolver used to translate Names to JCR name strings.
 
Constructor Summary
NodeDefinitionImpl(QItemDefinition itemDef, AbstractNodeTypeManager ntMgr, NamePathResolver resolver)
          Constructor to create a definition that is based on an existing node type.
NodeDefinitionImpl(QItemDefinition itemDef, NamePathResolver resolver)
          Constructor to create a definition that is based on a template.
 
Method Summary
 boolean allowsSameNameSiblings()
          
 boolean equals(Object o)
          
 NodeType getDeclaringNodeType()
          
 NodeType getDefaultPrimaryType()
          
 String getDefaultPrimaryTypeName()
           
 String getName()
          
 int getOnParentVersion()
          
 String[] getRequiredPrimaryTypeNames()
           
 NodeType[] getRequiredPrimaryTypes()
          
 int hashCode()
          
 boolean isAutoCreated()
          
 boolean isMandatory()
          
 boolean isProtected()
          
 QNodeDefinition 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

resolver

protected final NamePathResolver resolver
The namespace resolver used to translate Names to JCR name strings.


ntMgr

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


itemDef

protected final QItemDefinition itemDef
The wrapped item definition.

Constructor Detail

NodeDefinitionImpl

public NodeDefinitionImpl(QItemDefinition itemDef,
                          NamePathResolver resolver)
Constructor to create a definition that is based on a template.

Parameters:
itemDef - item definition
resolver -

NodeDefinitionImpl

public NodeDefinitionImpl(QItemDefinition itemDef,
                          AbstractNodeTypeManager ntMgr,
                          NamePathResolver resolver)
Constructor to create a definition that is based on an existing node type.

Parameters:
itemDef - item definition
resolver -
Method Detail

unwrap

public QNodeDefinition unwrap()
Returns the wrapped node definition.

Returns:
the wrapped node definition.

allowsSameNameSiblings

public boolean allowsSameNameSiblings()

Specified by:
allowsSameNameSiblings in interface NodeDefinition

getDefaultPrimaryTypeName

public String getDefaultPrimaryTypeName()
Specified by:
getDefaultPrimaryTypeName in interface NodeDefinition
Since:
JCR 2.0
See Also:
NodeDefinition.getDefaultPrimaryTypeName()

getDefaultPrimaryType

public NodeType getDefaultPrimaryType()

Specified by:
getDefaultPrimaryType in interface NodeDefinition

getRequiredPrimaryTypes

public NodeType[] getRequiredPrimaryTypes()

Specified by:
getRequiredPrimaryTypes in interface NodeDefinition

getRequiredPrimaryTypeNames

public String[] getRequiredPrimaryTypeNames()
Specified by:
getRequiredPrimaryTypeNames in interface NodeDefinition
Since:
JCR 2.0
See Also:
NodeDefinition.getRequiredPrimaryTypeNames()

getDeclaringNodeType

public NodeType getDeclaringNodeType()

Specified by:
getDeclaringNodeType in interface ItemDefinition

getName

public String getName()

Specified by:
getName in interface ItemDefinition

getOnParentVersion

public int getOnParentVersion()

Specified by:
getOnParentVersion in interface ItemDefinition

isAutoCreated

public boolean isAutoCreated()

Specified by:
isAutoCreated in interface ItemDefinition

isMandatory

public boolean isMandatory()

Specified by:
isMandatory in interface ItemDefinition

isProtected

public boolean isProtected()

Specified by:
isProtected in interface ItemDefinition

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


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