Class QNodeDefinitionBuilder
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.nodetype.QItemDefinitionBuilder
-
- org.apache.jackrabbit.spi.commons.nodetype.QNodeDefinitionBuilder
-
public class QNodeDefinitionBuilder extends QItemDefinitionBuilder
A builder for aQNodeDefinition
.
-
-
Constructor Summary
Constructors Constructor Description QNodeDefinitionBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRequiredPrimaryType(Name name)
Adds a required primary type of the node definition being built.QNodeDefinition
build()
Creates a newQNodeDefinition
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
-
-
-
-
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 newQNodeDefinition
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.
-
-