org.apache.jackrabbit.spi.commons.nodetype
Class QNodeDefinitionBuilder

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.nodetype.QItemDefinitionBuilder
      extended by org.apache.jackrabbit.spi.commons.nodetype.QNodeDefinitionBuilder

public class QNodeDefinitionBuilder
extends QItemDefinitionBuilder

A builder for a QNodeDefinition.


Constructor Summary
QNodeDefinitionBuilder()
           
 
Method Summary
 void addRequiredPrimaryType(Name name)
          Adds a required primary type of the node definition being built.
 QNodeDefinition build()
          Creates a new QNodeDefinition instance based on the state of this builder.
 boolean getAllowsSameNameSiblings()
           
 Name getDefaultPrimaryType()
           
 Name[] getRequiredPrimaryTypes()
           
 void setAllowsSameNameSiblings(boolean allowSns)
           
 void setDefaultPrimaryType(Name name)
           
 void setRequiredPrimaryTypes(Name[] names)
           
 
Methods inherited from class org.apache.jackrabbit.spi.commons.nodetype.QItemDefinitionBuilder
getAutoCreated, getDeclaringNodeType, getMandatory, getName, getOnParentVersion, getProtected, setAutoCreated, setDeclaringNodeType, setMandatory, setName, setOnParentVersion, setProtected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QNodeDefinitionBuilder

public QNodeDefinitionBuilder()
Method Detail

setDefaultPrimaryType

public void setDefaultPrimaryType(Name name)
Parameters:
name - the name of the default primary type of the node definition being built.

getDefaultPrimaryType

public Name getDefaultPrimaryType()
Returns:
the name of the default primary type of the node definition being built.

addRequiredPrimaryType

public void addRequiredPrimaryType(Name name)
Adds a required primary type of the node definition being built.

Parameters:
name - the name of a required primary type.

setRequiredPrimaryTypes

public void setRequiredPrimaryTypes(Name[] names)
Parameters:
names - array of names of the required primary types of the node definition being built.

getRequiredPrimaryTypes

public Name[] getRequiredPrimaryTypes()
Returns:
array of names of the required primary types of the node definition being built.

setAllowsSameNameSiblings

public void setAllowsSameNameSiblings(boolean allowSns)
Parameters:
allowSns - true if building a node definition with same name siblings, false otherwise.

getAllowsSameNameSiblings

public boolean getAllowsSameNameSiblings()
Returns:
true if building a node definition with same name siblings, false otherwise.

build

public QNodeDefinition build()
                      throws IllegalStateException
Creates a new QNodeDefinition instance based on the state of this builder.

Returns:
a new QNodeDefinition instance.
Throws:
IllegalStateException - if the instance has not the necessary information to build the QNodeDefinition instance.


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