org.apache.jackrabbit.core.nodetype
Class EffectiveNodeType

java.lang.Object
  extended by org.apache.jackrabbit.core.nodetype.EffectiveNodeType
All Implemented Interfaces:
Cloneable

public class EffectiveNodeType
extends Object
implements Cloneable

An EffectiveNodeType represents one or more NodeTypes as one 'effective' node type where inheritance is resolved.

Instances of EffectiveNodeType are immutable.


Method Summary
 void checkAddNodeConstraints(Name name)
           
 void checkAddNodeConstraints(Name name, Name nodeTypeName, NodeTypeRegistry ntReg)
           
 void checkRemoveItemConstraints(Name name)
           
 void checkRemoveNodeConstraints(Name name)
           
 void checkRemovePropertyConstraints(Name name)
           
static void checkSetPropertyValueConstraints(QPropertyDefinition pd, InternalValue[] values)
          Tests if the value constraints defined in the property definition pd are satisfied by the the specified values.
protected  Object clone()
           
 QItemDefinition[] getAllItemDefs()
           
 QNodeDefinition[] getAllNodeDefs()
           
 Name[] getAllNodeTypes()
           
 QPropertyDefinition[] getAllPropDefs()
           
 QNodeDefinition getApplicableChildNodeDef(Name name, Name nodeTypeName, NodeTypeRegistry ntReg)
          Returns the applicable child node definition for a child node with the specified name and node type.
 QPropertyDefinition getApplicablePropertyDef(Name name, int type)
          Returns the applicable property definition for a property with the specified name and type.
 QPropertyDefinition getApplicablePropertyDef(Name name, int type, boolean multiValued)
          Returns the applicable property definition for a property with the specified name, type and multiValued characteristic.
 QNodeDefinition[] getAutoCreateNodeDefs()
           
 QPropertyDefinition[] getAutoCreatePropDefs()
           
 Name[] getInheritedNodeTypes()
           
 QNodeDefinition[] getMandatoryNodeDefs()
           
 QPropertyDefinition[] getMandatoryPropDefs()
           
 Name[] getMergedNodeTypes()
           
 QItemDefinition[] getNamedItemDefs()
           
 QItemDefinition[] getNamedItemDefs(Name name)
           
 QNodeDefinition[] getNamedNodeDefs()
           
 QNodeDefinition[] getNamedNodeDefs(Name name)
           
 QPropertyDefinition[] getNamedPropDefs()
           
 QPropertyDefinition[] getNamedPropDefs(Name name)
           
 Name getPrimaryItemName()
           
 QItemDefinition[] getUnnamedItemDefs()
           
 QNodeDefinition[] getUnnamedNodeDefs()
           
 QPropertyDefinition[] getUnnamedPropDefs()
           
 boolean hasNamedItemDef(Name name)
           
 boolean hasOrderableChildNodes()
          Returns true if any of the included node types supports 'orderable child nodes'; returns false otherwise.
 boolean includesNodeType(Name nodeTypeName)
          Determines whether this effective node type representation includes (either through inheritance or aggregation) the given node type.
 boolean includesNodeTypes(Name[] nodeTypeNames)
          Determines whether this effective node type representation includes (either through inheritance or aggregation) all of the given node types.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasOrderableChildNodes

public boolean hasOrderableChildNodes()
Returns true if any of the included node types supports 'orderable child nodes'; returns false otherwise.

Returns:
true if this effective node type has orderable child nodes

getPrimaryItemName

public Name getPrimaryItemName()

getMergedNodeTypes

public Name[] getMergedNodeTypes()

getInheritedNodeTypes

public Name[] getInheritedNodeTypes()

getAllNodeTypes

public Name[] getAllNodeTypes()

getAllItemDefs

public QItemDefinition[] getAllItemDefs()

getNamedItemDefs

public QItemDefinition[] getNamedItemDefs()

getUnnamedItemDefs

public QItemDefinition[] getUnnamedItemDefs()

hasNamedItemDef

public boolean hasNamedItemDef(Name name)

getNamedItemDefs

public QItemDefinition[] getNamedItemDefs(Name name)

getAllNodeDefs

public QNodeDefinition[] getAllNodeDefs()

getNamedNodeDefs

public QNodeDefinition[] getNamedNodeDefs()

getNamedNodeDefs

public QNodeDefinition[] getNamedNodeDefs(Name name)

getUnnamedNodeDefs

public QNodeDefinition[] getUnnamedNodeDefs()

getAutoCreateNodeDefs

public QNodeDefinition[] getAutoCreateNodeDefs()

getAllPropDefs

public QPropertyDefinition[] getAllPropDefs()

getNamedPropDefs

public QPropertyDefinition[] getNamedPropDefs()

getNamedPropDefs

public QPropertyDefinition[] getNamedPropDefs(Name name)

getUnnamedPropDefs

public QPropertyDefinition[] getUnnamedPropDefs()

getAutoCreatePropDefs

public QPropertyDefinition[] getAutoCreatePropDefs()

getMandatoryPropDefs

public QPropertyDefinition[] getMandatoryPropDefs()

getMandatoryNodeDefs

public QNodeDefinition[] getMandatoryNodeDefs()

includesNodeType

public boolean includesNodeType(Name nodeTypeName)
Determines whether this effective node type representation includes (either through inheritance or aggregation) the given node type.

Parameters:
nodeTypeName - name of node type
Returns:
true if the given node type is included, otherwise false

includesNodeTypes

public boolean includesNodeTypes(Name[] nodeTypeNames)
Determines whether this effective node type representation includes (either through inheritance or aggregation) all of the given node types.

Parameters:
nodeTypeNames - array of node type names
Returns:
true if all of the given node types are included, otherwise false

checkSetPropertyValueConstraints

public static void checkSetPropertyValueConstraints(QPropertyDefinition pd,
                                                    InternalValue[] values)
                                             throws ConstraintViolationException,
                                                    RepositoryException
Tests if the value constraints defined in the property definition pd are satisfied by the the specified values.

Note that the protected flag is not checked. Also note that no type conversions are attempted if the type of the given values does not match the required type as specified in the given definition.

Parameters:
pd - The definiton of the property
values - An array of InternalValue objects.
Throws:
ConstraintViolationException - if the value constraints defined in the property definition are satisfied by the the specified values
RepositoryException - if another error occurs

checkAddNodeConstraints

public void checkAddNodeConstraints(Name name)
                             throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

checkAddNodeConstraints

public void checkAddNodeConstraints(Name name,
                                    Name nodeTypeName,
                                    NodeTypeRegistry ntReg)
                             throws ConstraintViolationException,
                                    NoSuchNodeTypeException
Parameters:
name -
nodeTypeName -
ntReg -
Throws:
ConstraintViolationException
NoSuchNodeTypeException

getApplicableChildNodeDef

public QNodeDefinition getApplicableChildNodeDef(Name name,
                                                 Name nodeTypeName,
                                                 NodeTypeRegistry ntReg)
                                          throws NoSuchNodeTypeException,
                                                 ConstraintViolationException
Returns the applicable child node definition for a child node with the specified name and node type. If there are multiple applicable definitions named definitions will take precedence over residual definitions.

Parameters:
name -
nodeTypeName -
ntReg -
Returns:
Throws:
NoSuchNodeTypeException
ConstraintViolationException - if no applicable child node definition could be found

getApplicablePropertyDef

public QPropertyDefinition getApplicablePropertyDef(Name name,
                                                    int type,
                                                    boolean multiValued)
                                             throws ConstraintViolationException
Returns the applicable property definition for a property with the specified name, type and multiValued characteristic. If there are multiple applicable definitions the following rules will be applied:

Parameters:
name -
type -
multiValued -
Returns:
Throws:
ConstraintViolationException - if no applicable property definition could be found

getApplicablePropertyDef

public QPropertyDefinition getApplicablePropertyDef(Name name,
                                                    int type)
                                             throws ConstraintViolationException
Returns the applicable property definition for a property with the specified name and type. The multiValued flag is not taken into account in the selection algorithm. Other than getApplicablePropertyDef(Name, int, boolean) this method does not take the multiValued flag into account in the selection algorithm. If there more than one applicable definitions then the following rules are applied:

Parameters:
name -
type -
Returns:
Throws:
ConstraintViolationException - if no applicable property definition could be found

checkRemoveItemConstraints

public void checkRemoveItemConstraints(Name name)
                                throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

checkRemoveNodeConstraints

public void checkRemoveNodeConstraints(Name name)
                                throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

checkRemovePropertyConstraints

public void checkRemovePropertyConstraints(Name name)
                                    throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

clone

protected Object clone()
Overrides:
clone in class Object


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