org.jboss.dna.jcr.nodetype
Interface PropertyDefinitionTemplate

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

@NotThreadSafe
public interface PropertyDefinitionTemplate
extends javax.jcr.nodetype.PropertyDefinition

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

See Also:
NodeTypeDefinition.getDeclaredPropertyDefinitions()

Method Summary
 void setAutoCreated(boolean autoCreated)
          Set whether this definition describes a child node that is auto-created by the system.
 void setDefaultValues(String[] defaultValues)
          Set the default values for the property, using their string representation.
 void setMandatory(boolean mandatory)
          Set whether this definition describes a child that is required (mandatory).
 void setMultiple(boolean multiple)
          Set whether the properties described by this definition may have multiple values.
 void setName(String name)
          Set the name of the property 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 setRequiredType(int requiredType)
          Set the required property type for the values of the property, or PropertyType.UNDEFINED if there is no type requirement
 void setValueConstraints(String[] constraints)
          Set the constraint expressions for the values of the property.
 
Methods inherited from interface javax.jcr.nodetype.PropertyDefinition
getDefaultValues, getRequiredType, getValueConstraints, isMultiple
 
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 the property definition

Parameters:
name - the name

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

setRequiredType

void setRequiredType(int requiredType)
Set the required property type for the values of the property, or PropertyType.UNDEFINED if there is no type requirement

Parameters:
requiredType - the required type for the property values

setValueConstraints

void setValueConstraints(String[] constraints)
Set the constraint expressions for the values of the property. See PropertyDefinition.getValueConstraints() for more details about the formats of the constraints.

Parameters:
constraints - the value constraints, or null or an empty array if there are no constraints.

setDefaultValues

void setDefaultValues(String[] defaultValues)
Set the default values for the property, using their string representation. See PropertyDefinition.getDefaultValues() for more details.

Parameters:
defaultValues - the string representation of the default values, or null or an empty array if there are no default values

setMultiple

void setMultiple(boolean multiple)
Set whether the properties described by this definition may have multiple values.

Parameters:
multiple - true if the properties may have multiple values, or false if they are limited to one value each


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