org.apache.jackrabbit.spi.commons
Class QNodeDefinitionImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.QItemDefinitionImpl
      extended by org.apache.jackrabbit.spi.commons.QNodeDefinitionImpl
All Implemented Interfaces:
Serializable, org.apache.jackrabbit.spi.QItemDefinition, org.apache.jackrabbit.spi.QNodeDefinition

public class QNodeDefinitionImpl
extends QItemDefinitionImpl
implements org.apache.jackrabbit.spi.QNodeDefinition

QNodeDefinitionImpl implements a QNodeDefinition.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jackrabbit.spi.commons.QItemDefinitionImpl
hashCode
 
Fields inherited from interface org.apache.jackrabbit.spi.QNodeDefinition
EMPTY_ARRAY
 
Constructor Summary
QNodeDefinitionImpl(org.apache.jackrabbit.spi.Name name, org.apache.jackrabbit.spi.Name declaringNodeType, boolean isAutoCreated, boolean isMandatory, int onParentVersion, boolean isProtected, org.apache.jackrabbit.spi.Name defaultPrimaryType, org.apache.jackrabbit.spi.Name[] requiredPrimaryTypes, boolean allowsSameNameSiblings)
          Creates a new SPI node definition based on a JCR NodeDefinition.
QNodeDefinitionImpl(NodeDefinition nodeDef, NamePathResolver resolver)
          Creates a new node definition based on a JCR NodeDefinition.
QNodeDefinitionImpl(org.apache.jackrabbit.spi.QNodeDefinition nodeDef)
          Copy constructor.
 
Method Summary
 boolean allowsSameNameSiblings()
          
 boolean definesNode()
          
 boolean equals(Object obj)
          Compares two node definitions for equality.
 org.apache.jackrabbit.spi.Name getDefaultPrimaryType()
          
 org.apache.jackrabbit.spi.Name[] getRequiredPrimaryTypes()
          
 int hashCode()
          Overwrites QItemDefinitionImpl.hashCode().
 
Methods inherited from class org.apache.jackrabbit.spi.commons.QItemDefinitionImpl
definesResidual, getDeclaringNodeType, getName, getOnParentVersion, isAutoCreated, isMandatory, isProtected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.spi.QItemDefinition
definesResidual, getDeclaringNodeType, getName, getOnParentVersion, isAutoCreated, isMandatory, isProtected
 

Constructor Detail

QNodeDefinitionImpl

public QNodeDefinitionImpl(org.apache.jackrabbit.spi.QNodeDefinition nodeDef)
Copy constructor.

Parameters:
nodeDef - some other node definition.

QNodeDefinitionImpl

public QNodeDefinitionImpl(org.apache.jackrabbit.spi.Name name,
                           org.apache.jackrabbit.spi.Name declaringNodeType,
                           boolean isAutoCreated,
                           boolean isMandatory,
                           int onParentVersion,
                           boolean isProtected,
                           org.apache.jackrabbit.spi.Name defaultPrimaryType,
                           org.apache.jackrabbit.spi.Name[] requiredPrimaryTypes,
                           boolean allowsSameNameSiblings)
Creates a new SPI node definition based on a JCR NodeDefinition.

Parameters:
name - the name of the child item.
declaringNodeType - the declaring node type
isAutoCreated - if this item is auto created.
isMandatory - if this is a mandatory item.
onParentVersion - the on parent version behaviour.
isProtected - if this item is protected.
defaultPrimaryType - the default primary type name
requiredPrimaryTypes - the required primary type name
allowsSameNameSiblings - if this node allows SNS

QNodeDefinitionImpl

public QNodeDefinitionImpl(NodeDefinition nodeDef,
                           NamePathResolver resolver)
                    throws NameException,
                           NamespaceException
Creates a new node definition based on a JCR NodeDefinition.

Parameters:
nodeDef - the node definition.
resolver - the name/path resolver of the session that provided the node definition
Throws:
NameException - if nodeDef contains an illegal name.
NamespaceException - if nodeDef contains a name with an namespace prefix that is unknown to resolver.
Method Detail

getDefaultPrimaryType

public org.apache.jackrabbit.spi.Name getDefaultPrimaryType()

Specified by:
getDefaultPrimaryType in interface org.apache.jackrabbit.spi.QNodeDefinition

getRequiredPrimaryTypes

public org.apache.jackrabbit.spi.Name[] getRequiredPrimaryTypes()

Specified by:
getRequiredPrimaryTypes in interface org.apache.jackrabbit.spi.QNodeDefinition

allowsSameNameSiblings

public boolean allowsSameNameSiblings()

Specified by:
allowsSameNameSiblings in interface org.apache.jackrabbit.spi.QNodeDefinition

definesNode

public boolean definesNode()

Specified by:
definesNode in interface org.apache.jackrabbit.spi.QItemDefinition
Returns:
always true

equals

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

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

hashCode

public int hashCode()
Overwrites QItemDefinitionImpl.hashCode().

Overrides:
hashCode in class QItemDefinitionImpl
Returns:
the hash code


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