org.jboss.dna.jcr.nodetype
Interface NodeDefinitionTemplate

All Superinterfaces:
javax.jcr.nodetype.ItemDefinition, javax.jcr.nodetype.NodeDefinition

@NotThreadSafe
public interface NodeDefinitionTemplate
extends javax.jcr.nodetype.NodeDefinition

A template that can be used to create new child node definitions, patterned after the approach in the proposed JSR-283. This interface extends the standard NodeTypeDefinition interface and adds setter methods for the various attributes.

See Also:
NodeTypeDefinition.getDeclaredNodeDefinitions()

Method Summary
 void setAutoCreated(boolean autoCreated)
          Set whether this definition describes a child node that is auto-created by the system.
 void setDefaultPrimaryType(String defaultPrimaryType)
          Set the name of the primary type that should be used by default when creating children using this node definition.
 void setMandatory(boolean mandatory)
          Set whether this definition describes a child that is required (mandatory).
 void setName(String name)
          Set the name of this child node definition.
 void setOnParentVersion(int opv)
          Set the mode for the versioning of the child with respect to versioning of the parent.
 void setProtected(boolean isProtected)
          Set whether the child node described by this definition is protected from changes through the JCR API.
 void setRequiredPrimaryTypes(String[] requiredPrimaryTypes)
          Set the names of the primary types that must appear on the child(ren) described by this definition
 void setSameNameSiblings(boolean allowSameNameSiblings)
          Set whether the children described by this definition may have the same names (and therefore distinguished only by their same-name-sibiling index).
 
Methods inherited from interface javax.jcr.nodetype.NodeDefinition
allowsSameNameSiblings, getDefaultPrimaryType, getRequiredPrimaryTypes
 
Methods inherited from interface javax.jcr.nodetype.ItemDefinition
getDeclaringNodeType, getName, getOnParentVersion, isAutoCreated, isMandatory, isProtected
 

Method Detail

setName

void setName(String name)
Set the name of this child node definition.

Parameters:
name - the name for this child node definition.

setAutoCreated

void setAutoCreated(boolean autoCreated)
Set whether this definition describes a child node that is auto-created by the system.

Parameters:
autoCreated - true if this child should be auto-created

setMandatory

void setMandatory(boolean mandatory)
Set whether this definition describes a child that is required (mandatory).

Parameters:
mandatory - true if the child is mandatory

setOnParentVersion

void setOnParentVersion(int opv)
Set the mode for the versioning of the child with respect to versioning of the parent.

Parameters:
opv - the on-parent versioning mode; one of OnParentVersionAction values.

setProtected

void setProtected(boolean isProtected)
Set whether the child node described by this definition is protected from changes through the JCR API.

Parameters:
isProtected - true if the child node is protected, or false if it may be changed through the JCR API

setRequiredPrimaryTypes

void setRequiredPrimaryTypes(String[] requiredPrimaryTypes)
Set the names of the primary types that must appear on the child(ren) described by this definition

Parameters:
requiredPrimaryTypes - the names of the required primary types, or null or empty if there are no requirements for the primary types of the children described by this definition

setDefaultPrimaryType

void setDefaultPrimaryType(String defaultPrimaryType)
Set the name of the primary type that should be used by default when creating children using this node definition.

Parameters:
defaultPrimaryType - the name of the primary type that should be used by default, or null if there is none

setSameNameSiblings

void setSameNameSiblings(boolean allowSameNameSiblings)
Set whether the children described by this definition may have the same names (and therefore distinguished only by their same-name-sibiling index).

Parameters:
allowSameNameSiblings - true if the children described by this definition may have the same names, or false otherwise


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.