org.apache.jackrabbit.core.nodetype
Class ItemDefImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.nodetype.ItemDefImpl
All Implemented Interfaces:
ItemDef
Direct Known Subclasses:
NodeDefImpl, PropDefImpl

public abstract class ItemDefImpl
extends Object
implements ItemDef

This abstract class implements the ItemDef interface and additionally provides setter methods for the various item definition attributes.


Field Summary
protected  QName declaringNodeType
          The name of the declaring node type.
 
Fields inherited from interface org.apache.jackrabbit.core.nodetype.ItemDef
ANY_NAME, EMPTY_ARRAY
 
Constructor Summary
ItemDefImpl()
          Default constructor.
 
Method Summary
 boolean definesResidual()
          Determines whether this item definition defines a residual set of child items. This is equivalent to calling getName().equals(ANY_NAME).
 boolean equals(Object obj)
          Compares two item definitions for equality.
 QName getDeclaringNodeType()
          Gets the name of the declaring node type.
 QName getName()
          Gets the name of the child item.
 int getOnParentVersion()
          Gets the 'onParentVersion' attribute of the item.
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 boolean isAutoCreated()
          Determines whether the item is 'autoCreated'.
 boolean isMandatory()
          Determines whether the item is 'mandatory'.
 boolean isProtected()
          Determines whether the item is 'protected'.
 void setAutoCreated(boolean autoCreated)
          Sets the 'autoCreated' flag.
 void setDeclaringNodeType(QName declaringNodeType)
          Sets the name of declaring node type.
 void setMandatory(boolean mandatory)
          Sets the 'mandatory' flag.
 void setName(QName name)
          Sets the name of the child item.
 void setOnParentVersion(int onParentVersion)
          Sets the 'onParentVersion' attribute.
 void setProtected(boolean writeProtected)
          Sets the 'protected' flag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.core.nodetype.ItemDef
definesNode
 

Field Detail

declaringNodeType

protected QName declaringNodeType
The name of the declaring node type.

Constructor Detail

ItemDefImpl

public ItemDefImpl()
Default constructor.

Method Detail

setDeclaringNodeType

public void setDeclaringNodeType(QName declaringNodeType)
Sets the name of declaring node type.

Parameters:
declaringNodeType - name of the declaring node type (must not be null)

setName

public void setName(QName name)
Sets the name of the child item.

Parameters:
name - name of child item (must not be null)

setAutoCreated

public void setAutoCreated(boolean autoCreated)
Sets the 'autoCreated' flag.

Parameters:
autoCreated - a boolean

setOnParentVersion

public void setOnParentVersion(int onParentVersion)
Sets the 'onParentVersion' attribute.

Parameters:
onParentVersion - any of the following constants:
  • OnParentVersionAction.COPY
  • OnParentVersionAction.VERSION
  • OnParentVersionAction.INITIALIZE
  • OnParentVersionAction.COMPUTE
  • OnParentVersionAction.IGNORE
  • OnParentVersionAction.ABORT

setProtected

public void setProtected(boolean writeProtected)
Sets the 'protected' flag.

Parameters:
writeProtected - a boolean

setMandatory

public void setMandatory(boolean mandatory)
Sets the 'mandatory' flag.

Parameters:
mandatory - a boolean

getDeclaringNodeType

public QName getDeclaringNodeType()
Gets the name of the declaring node type.

Specified by:
getDeclaringNodeType in interface ItemDef
Returns:
the name of the declaring node type.

getName

public QName getName()
Gets the name of the child item.

Specified by:
getName in interface ItemDef
Returns:
the name of the child item.

isAutoCreated

public boolean isAutoCreated()
Determines whether the item is 'autoCreated'.

Specified by:
isAutoCreated in interface ItemDef
Returns:
the 'autoCreated' flag.

getOnParentVersion

public int getOnParentVersion()
Gets the 'onParentVersion' attribute of the item.

Specified by:
getOnParentVersion in interface ItemDef
Returns:
the 'onParentVersion' attribute.

isProtected

public boolean isProtected()
Determines whether the item is 'protected'.

Specified by:
isProtected in interface ItemDef
Returns:
the 'protected' flag.

isMandatory

public boolean isMandatory()
Determines whether the item is 'mandatory'.

Specified by:
isMandatory in interface ItemDef
Returns:
the 'mandatory' flag.

definesResidual

public boolean definesResidual()
Determines whether this item definition defines a residual set of child items. This is equivalent to calling getName().equals(ANY_NAME).

Specified by:
definesResidual in interface ItemDef
Returns:
true if this definition defines a residual set; false otherwise.

equals

public boolean equals(Object obj)
Compares two item definitions for equality. Returns true if the given object is an item defintion and has the same attributes as this item definition.

Parameters:
obj - the object to compare this item definition with
Returns:
true if the object is equal to this item definition, false otherwise
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.

Returns:
always zero
See Also:
Object.hashCode()


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