Package com.day.cq.wcm.foundation.forms
Class FieldDescription
- java.lang.Object
 - 
- com.day.cq.wcm.foundation.forms.FieldDescription
 
 
- 
public class FieldDescription extends java.lang.ObjectA description of a form field as it is later used in the html form. A field component usually maps to a single field description, however compound fields like an address field map to several field descriptions. The field description is used mostly during validation as it contains all necessary information. Field descriptions can be maintained from theFieldHelper.- Since:
 - 5.3
 
 
- 
- 
Constructor Summary
Constructors Constructor Description FieldDescription(Resource rsrc)Construct a new field description for a field resource.FieldDescription(Resource rsrc, java.lang.String name)Construct a new field description for a field resource and set the name property. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetConstraintMessage()The error message if the constraint is not met.java.lang.StringgetConstraintType()Get the constraint type (might be null).ResourcegetFieldResource()Return the associated field resourcejava.lang.StringgetName()Return the name of the field.java.lang.StringgetRequiredMessage()Return the error message for a required field.booleanisMultiValue()Is this a multi value field?booleanisPrivate()Is this a private field?booleanisReadOnly()Is this field readonly?booleanisRequired()Is this field required?voidsetConstraintMessage(java.lang.String constraintMsg)Set error message if the constraint is not met.voidsetConstraintType(java.lang.String constraintType)Set the constraint type (might be null).voidsetMultiValue(boolean flag)Set if this is a private field.voidsetName(java.lang.String name)Set the name for the field.voidsetPrivateField(boolean flag)Set if this is a private field.voidsetReadOnly(boolean readOnly)Set if this field is readonly.voidsetRequired(boolean required)Set if this field is required.voidsetRequiredMessage(java.lang.String requiredMsg)Set the error message for a required field.voidupdate(Resource rsrc) 
 - 
 
- 
- 
Constructor Detail
- 
FieldDescription
public FieldDescription(Resource rsrc)
Construct a new field description for a field resource.- Parameters:
 rsrc- field resource
 
- 
FieldDescription
public FieldDescription(Resource rsrc, java.lang.String name)
Construct a new field description for a field resource and set the name property.- Parameters:
 rsrc- The resourcename- The field name.
 
 - 
 
- 
Method Detail
- 
update
public void update(Resource rsrc)
 
- 
getFieldResource
public Resource getFieldResource()
Return the associated field resource- Returns:
 - field resource
 
 
- 
getName
public java.lang.String getName()
Return the name of the field.- Returns:
 - name of the field
 
 
- 
setName
public void setName(java.lang.String name)
Set the name for the field.- Parameters:
 name- field name
 
- 
isRequired
public boolean isRequired()
Is this field required?- Returns:
 - true if field is required
 
 
- 
setRequired
public void setRequired(boolean required)
Set if this field is required.- Parameters:
 required- indicates whether field is required
 
- 
getRequiredMessage
public java.lang.String getRequiredMessage()
Return the error message for a required field.- Returns:
 - error message for a required field
 
 
- 
setRequiredMessage
public void setRequiredMessage(java.lang.String requiredMsg)
Set the error message for a required field.- Parameters:
 requiredMsg- error message for a required field
 
- 
getConstraintType
public java.lang.String getConstraintType()
Get the constraint type (might be null).- Returns:
 - constraint type
 
 
- 
setConstraintType
public void setConstraintType(java.lang.String constraintType)
Set the constraint type (might be null).- Parameters:
 constraintType- constraint type
 
- 
getConstraintMessage
public java.lang.String getConstraintMessage()
The error message if the constraint is not met.- Returns:
 - error message if the constraint is not met
 
 
- 
setConstraintMessage
public void setConstraintMessage(java.lang.String constraintMsg)
Set error message if the constraint is not met.- Parameters:
 constraintMsg- error message if the constraint is not met
 
- 
isReadOnly
public boolean isReadOnly()
Is this field readonly?- Returns:
 - true if field is read only
 
 
- 
setReadOnly
public void setReadOnly(boolean readOnly)
Set if this field is readonly.- Parameters:
 readOnly- indicates whether field is read only
 
- 
isPrivate
public boolean isPrivate()
Is this a private field?- Returns:
 - true if field is private
 
 
- 
setPrivateField
public void setPrivateField(boolean flag)
Set if this is a private field.- Parameters:
 flag- indicates whether field is private
 
- 
isMultiValue
public boolean isMultiValue()
Is this a multi value field?- Returns:
 - true if field is multi value
 
 
- 
setMultiValue
public void setMultiValue(boolean flag)
Set if this is a private field.- Parameters:
 flag- indicates whether field is multi value
 
 - 
 
 -