org.apache.jackrabbit.core.nodetype
Class NodeTypeDef

java.lang.Object
  extended byorg.apache.jackrabbit.core.nodetype.NodeTypeDef
All Implemented Interfaces:
Cloneable

public class NodeTypeDef
extends Object
implements Cloneable

A NodeTypeDef holds the definition of a node type.


Constructor Summary
NodeTypeDef()
          Default constructor.
 
Method Summary
 Object clone()
           
 boolean equals(Object obj)
           
 NodeDef[] getChildNodeDefs()
          Returns an array containing the child node definitions or null if not set.
 Collection getDependencies()
          Returns a collection of node type QNames that are being referenced by this node type definition (e.g.
 QName getName()
          Returns the name of the node type being defined or null if not set.
 QName getPrimaryItemName()
          Returns the name of the primary item (one of the child items of the node's of this node type) or null if not set.
 PropDef[] getPropertyDefs()
          Returns an array containing the property definitions or null if not set.
 QName[] getSupertypes()
          Returns an array containing the names of the supertypes or null if not set.
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 boolean hasOrderableChildNodes()
          Returns the value of the orderableChildNodes flag.
 boolean isMixin()
          Returns the value of the mixin flag.
 void setChildNodeDefs(NodeDef[] defs)
          Sets the child node definitions.
 void setMixin(boolean mixin)
          Sets the mixin flag.
 void setName(QName name)
          Sets the name of the node type being defined.
 void setOrderableChildNodes(boolean orderableChildNodes)
          Sets the orderableChildNodes flag.
 void setPrimaryItemName(QName primaryItemName)
          Sets the name of the primary item (one of the child items of the node's of this node type)
 void setPropertyDefs(PropDef[] defs)
          Sets the property definitions.
 void setSupertypes(QName[] names)
          Sets the supertypes.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTypeDef

public NodeTypeDef()
Default constructor.

Method Detail

getDependencies

public Collection getDependencies()
Returns a collection of node type QNames that are being referenced by this node type definition (e.g. as supertypes, as required/default primary types in child node definitions, as REFERENCE value constraints in property definitions).

Note that self-references (e.g. a child node definition that specifies the declaring node type as the default primary type) are not considered dependencies.

Returns:
a collection of node type QNames

setName

public void setName(QName name)
Sets the name of the node type being defined.

Parameters:
name - The name of the node type.

setSupertypes

public void setSupertypes(QName[] names)
Sets the supertypes.

Parameters:
names - the names of the supertypes.

setMixin

public void setMixin(boolean mixin)
Sets the mixin flag.

Parameters:
mixin - flag

setOrderableChildNodes

public void setOrderableChildNodes(boolean orderableChildNodes)
Sets the orderableChildNodes flag.

Parameters:
orderableChildNodes - flag

setPrimaryItemName

public void setPrimaryItemName(QName primaryItemName)
Sets the name of the primary item (one of the child items of the node's of this node type)

Parameters:
primaryItemName - The name of the primary item.

setPropertyDefs

public void setPropertyDefs(PropDef[] defs)
Sets the property definitions.

Parameters:
defs - An array of PropertyDef objects.

setChildNodeDefs

public void setChildNodeDefs(NodeDef[] defs)
Sets the child node definitions.

Parameters:
defs - An array of NodeDef objects

getName

public QName getName()
Returns the name of the node type being defined or null if not set.

Returns:
the name of the node type or null if not set.

getSupertypes

public QName[] getSupertypes()
Returns an array containing the names of the supertypes or null if not set.

Returns:
an array listing the names of the supertypes or null if not set.

isMixin

public boolean isMixin()
Returns the value of the mixin flag.

Returns:
true if this is a mixin node type; false otherwise.

hasOrderableChildNodes

public boolean hasOrderableChildNodes()
Returns the value of the orderableChildNodes flag.

Returns:
true if nodes of this node type can have orderable child nodes; false otherwise.

getPrimaryItemName

public QName getPrimaryItemName()
Returns the name of the primary item (one of the child items of the node's of this node type) or null if not set.

Returns:
the name of the primary item or null if not set.

getPropertyDefs

public PropDef[] getPropertyDefs()
Returns an array containing the property definitions or null if not set.

Returns:
an array containing the property definitions or null if not set.

getChildNodeDefs

public NodeDef[] getChildNodeDefs()
Returns an array containing the child node definitions or null if not set.

Returns:
an array containing the child node definitions or null if not set.

clone

public Object clone()

equals

public boolean equals(Object obj)

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.