org.apache.jackrabbit.spi.commons
Class QNodeTypeDefinitionImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl
All Implemented Interfaces:
Serializable, QNodeTypeDefinition

public class QNodeTypeDefinitionImpl
extends Object
implements QNodeTypeDefinition, Serializable

QNodeTypeDefinitionImpl implements a serializable qualified node type definition.

See Also:
Serialized Form

Constructor Summary
QNodeTypeDefinitionImpl(Name name, Name[] supertypes, boolean isMixin, boolean hasOrderableChildNodes, Name primaryItemName, QPropertyDefinition[] declaredPropDefs, QNodeDefinition[] declaredNodeDefs)
          Deprecated. use QNodeTypeDefinitionImpl(Name, Name[], Name[], boolean, boolean, Name, QPropertyDefinition[], QNodeDefinition[])
QNodeTypeDefinitionImpl(Name name, Name[] supertypes, Name[] supportedMixins, boolean isMixin, boolean hasOrderableChildNodes, Name primaryItemName, QPropertyDefinition[] declaredPropDefs, QNodeDefinition[] declaredNodeDefs)
          Creates a new serializable qualified node type definition.
QNodeTypeDefinitionImpl(QNodeTypeDefinition nt)
          Copy constructor.
 
Method Summary
 QNodeDefinition[] getChildNodeDefs()
          Returns an array containing the child node definitions.
 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.
 QPropertyDefinition[] getPropertyDefs()
          Returns an array containing the property definitions.
 Name[] getSupertypes()
          Returns an array containing the names of the supertypes.
 Name[] getSupportedMixinTypes()
          Returns an array containing the names of additional mixin types supported on this node type.
 boolean hasOrderableChildNodes()
          Returns the value of the orderableChildNodes flag.
 boolean isMixin()
          Returns the value of the mixin flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QNodeTypeDefinitionImpl

public QNodeTypeDefinitionImpl(QNodeTypeDefinition nt)
Copy constructor.

Parameters:
nt - the qualified node type definition.

QNodeTypeDefinitionImpl

public QNodeTypeDefinitionImpl(Name name,
                               Name[] supertypes,
                               boolean isMixin,
                               boolean hasOrderableChildNodes,
                               Name primaryItemName,
                               QPropertyDefinition[] declaredPropDefs,
                               QNodeDefinition[] declaredNodeDefs)
Deprecated. use QNodeTypeDefinitionImpl(Name, Name[], Name[], boolean, boolean, Name, QPropertyDefinition[], QNodeDefinition[])

Creates a new serializable qualified node type definition.

Parameters:
name - the name of the node type
supertypes - the names of the supertypes
isMixin - if this is a mixin node type
hasOrderableChildNodes - if this node type has orderable child nodes.
primaryItemName - the name of the primary item, or null.
declaredPropDefs - the declared property definitions.
declaredNodeDefs - the declared child node definitions.

QNodeTypeDefinitionImpl

public QNodeTypeDefinitionImpl(Name name,
                               Name[] supertypes,
                               Name[] supportedMixins,
                               boolean isMixin,
                               boolean hasOrderableChildNodes,
                               Name primaryItemName,
                               QPropertyDefinition[] declaredPropDefs,
                               QNodeDefinition[] declaredNodeDefs)
Creates a new serializable qualified node type definition.

Parameters:
name - the name of the node type
supertypes - the names of the supertypes
supportedMixins - the names of supported mixins (or null)
isMixin - if this is a mixin node type
hasOrderableChildNodes - if this node type has orderable child nodes.
primaryItemName - the name of the primary item, or null.
declaredPropDefs - the declared property definitions.
declaredNodeDefs - the declared child node definitions.
Method Detail

getName

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

Specified by:
getName in interface QNodeTypeDefinition
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.

Specified by:
getSupertypes in interface QNodeTypeDefinition
Returns:
an array of supertype names

isMixin

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

Specified by:
isMixin in interface QNodeTypeDefinition
Returns:
true if this is a mixin node type; false otherwise.

hasOrderableChildNodes

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

Specified by:
hasOrderableChildNodes in interface QNodeTypeDefinition
Returns:
true if nodes of this node type can have orderable child nodes; 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.

Specified by:
getPrimaryItemName in interface QNodeTypeDefinition
Returns:
the name of the primary item or null if not set.

getPropertyDefs

public QPropertyDefinition[] getPropertyDefs()
Returns an array containing the property definitions.

Specified by:
getPropertyDefs in interface QNodeTypeDefinition
Returns:
an array containing the property definitions.

getChildNodeDefs

public QNodeDefinition[] getChildNodeDefs()
Returns an array containing the child node definitions.

Specified by:
getChildNodeDefs in interface QNodeTypeDefinition
Returns:
an array containing the child node definitions.

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.

Specified by:
getDependencies in interface QNodeTypeDefinition
Returns:
a collection of node type Names

getSupportedMixinTypes

public Name[] getSupportedMixinTypes()
Description copied from interface: QNodeTypeDefinition
Returns an array containing the names of additional mixin types supported on this node type.

The returned array must not be modified by the application.

Specified by:
getSupportedMixinTypes in interface QNodeTypeDefinition
Returns:
an array of mixin type names, or null when there are no known constraints.


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