org.apache.jackrabbit.core.nodetype
Class NodeTypeDef

java.lang.Object
  extended by org.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 Names 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).
 Name getName()
          Returns the name of the node type being defined or null if not set.
 Name 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.
 Name[] getSupertypes()
          Returns an array containing the names of the supertypes.
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 boolean hasOrderableChildNodes()
          Returns the value of the orderableChildNodes flag.
 boolean isAbstract()
          Returns the value of the 'abstract' flag.
 boolean isMixin()
          Returns the value of the mixin flag.
 void setAbstract(boolean abstractStatus)
          Sets the 'abstract' flag.
 void setChildNodeDefs(NodeDef[] defs)
          Sets the child node definitions.
 void setMixin(boolean mixin)
          Sets the mixin flag.
 void setName(Name name)
          Sets the name of the node type being defined.
 void setOrderableChildNodes(boolean orderableChildNodes)
          Sets the orderableChildNodes flag.
 void setPrimaryItemName(Name 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(Name[] 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 Names 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 Names

setName

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

Parameters:
name - The name of the node type.

setSupertypes

public void setSupertypes(Name[] 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

setAbstract

public void setAbstract(boolean abstractStatus)
Sets the 'abstract' flag.

Parameters:
abstractStatus - flag

setPrimaryItemName

public void setPrimaryItemName(Name 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 Name 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 Name[] getSupertypes()
Returns an array containing the names of the supertypes. If no supertypes have been specified, then an empty array is returned for mixin types and the nt:base primary type and an array containing just nt:base for other primary types.

The returned array must not be modified by the application.

Returns:
a sorted array of supertype names

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.

isAbstract

public boolean isAbstract()
Returns the value of the 'abstract' flag.

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

getPrimaryItemName

public Name 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()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class 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.

Overrides:
hashCode in class Object
Returns:
always zero
See Also:
Object.hashCode()


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