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(QName name)
           
 void checkAddNodeConstraints(QName name, QName nodeTypeName, NodeTypeRegistry ntReg)
           
 void checkRemoveItemConstraints(QName name)
           
static void checkSetPropertyValueConstraints(PropDef pd, InternalValue[] values)
          Tests if the value constraints defined in the property definition pd are satisfied by the the specified values.
protected  Object clone()
           
 ItemDef[] getAllItemDefs()
           
 NodeDef[] getAllNodeDefs()
           
 QName[] getAllNodeTypes()
           
 PropDef[] getAllPropDefs()
           
 NodeDef getApplicableChildNodeDef(QName name, QName nodeTypeName, NodeTypeRegistry ntReg)
          Returns the applicable child node definition for a child node with the specified name and node type.
 PropDef getApplicablePropertyDef(QName name, int type)
          Returns the applicable property definition for a property with the specified name and type.
 PropDef getApplicablePropertyDef(QName name, int type, boolean multiValued)
          Returns the applicable property definition for a property with the specified name, type and multiValued characteristic.
 NodeDef[] getAutoCreateNodeDefs()
           
 PropDef[] getAutoCreatePropDefs()
           
 QName[] getInheritedNodeTypes()
           
 NodeDef[] getMandatoryNodeDefs()
           
 PropDef[] getMandatoryPropDefs()
           
 QName[] getMergedNodeTypes()
           
 ItemDef[] getNamedItemDefs()
           
 ItemDef[] getNamedItemDefs(QName name)
           
 NodeDef[] getNamedNodeDefs()
           
 NodeDef[] getNamedNodeDefs(QName name)
           
 PropDef[] getNamedPropDefs()
           
 PropDef[] getNamedPropDefs(QName name)
           
 ItemDef[] getUnnamedItemDefs()
           
 NodeDef[] getUnnamedNodeDefs()
           
 PropDef[] getUnnamedPropDefs()
           
 boolean hasNamedItemDef(QName name)
           
 boolean includesNodeType(QName nodeTypeName)
          Determines whether this effective node type representation includes (either through inheritance or aggregation) the given node type.
 boolean includesNodeTypes(QName[] 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

getMergedNodeTypes

public QName[] getMergedNodeTypes()

getInheritedNodeTypes

public QName[] getInheritedNodeTypes()

getAllNodeTypes

public QName[] getAllNodeTypes()

getAllItemDefs

public ItemDef[] getAllItemDefs()

getNamedItemDefs

public ItemDef[] getNamedItemDefs()

getUnnamedItemDefs

public ItemDef[] getUnnamedItemDefs()

hasNamedItemDef

public boolean hasNamedItemDef(QName name)

getNamedItemDefs

public ItemDef[] getNamedItemDefs(QName name)

getAllNodeDefs

public NodeDef[] getAllNodeDefs()

getNamedNodeDefs

public NodeDef[] getNamedNodeDefs()

getNamedNodeDefs

public NodeDef[] getNamedNodeDefs(QName name)

getUnnamedNodeDefs

public NodeDef[] getUnnamedNodeDefs()

getAutoCreateNodeDefs

public NodeDef[] getAutoCreateNodeDefs()

getAllPropDefs

public PropDef[] getAllPropDefs()

getNamedPropDefs

public PropDef[] getNamedPropDefs()

getNamedPropDefs

public PropDef[] getNamedPropDefs(QName name)

getUnnamedPropDefs

public PropDef[] getUnnamedPropDefs()

getAutoCreatePropDefs

public PropDef[] getAutoCreatePropDefs()

getMandatoryPropDefs

public PropDef[] getMandatoryPropDefs()

getMandatoryNodeDefs

public NodeDef[] getMandatoryNodeDefs()

includesNodeType

public boolean includesNodeType(QName 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(QName[] 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(PropDef 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(QName name)
                             throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

checkAddNodeConstraints

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

getApplicableChildNodeDef

public NodeDef getApplicableChildNodeDef(QName name,
                                         QName 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 PropDef getApplicablePropertyDef(QName 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 PropDef getApplicablePropertyDef(QName 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(QName, 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(QName name)
                                throws ConstraintViolationException
Parameters:
name -
Throws:
ConstraintViolationException

clone

protected Object clone()
Overrides:
clone in class Object


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