Class Field
java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.Field
- All Implemented Interfaces:
IElement
,IField
,Serializable
This class defines the Field element.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Field
(String name, DataType type, boolean multivalue, IMultilingualText questionText, IMultilingualText explainText) Constructs the field with the most common attributes. -
Method Summary
Modifier and TypeMethodDescriptionThis method will invoke the visitor for this runtime element.boolean
addMessage
(IMessage message) This method may be used to add a message to the field.void
addParameter
(IGlobalParameterValue parameter) boolean
addValidation
(IFieldValidation validation) This method may be used to add a validation to the field.This method should clone the element and return the cloned element.boolean
Returns the data type of the field.int
This method return the maximum length for the field.This method will return the set of values that are currently valid for this field.This method will return the set of values that are available for this field.Get the explain text for this field.IMessage[]
This method will return the error or waning messages applicable to this field.Returns the evaluated parameters of this field.Get the question text for this field.This method will return the rejected value in case there are warnings or errors applicable to this field.This method returns the validations that are defined for this field.getValue()
This method returns the value of the field.int
hashCode()
boolean
The cardinality of the field.boolean
This method return a boolean indicating if a change in value should posted.boolean
This method will return true when the field is required.setDisplayLength
(int length) This method may be used to indicate the maximum length of the field value.setDomain
(IDomainValue[] values) This method may be used to set the values that are valid for this field.setDomain
(IPrimitiveValue[] values) This method may be used to set the values that are valid for this field.This method may be used to set the values that are valid for this field.void
setExplainText
(IMultilingualText textValue) This method may be used to override the explain text for the field.setMessages
(IMessage[] messages) This method may be used to set messages for the field.void
setMultiValue
(boolean isMultiValued) This method may be used to override if multiple values are allowed for this field.void
setQuestionText
(IMultilingualText textValue) This method may be used to override the question text for the field.setRefresh
(boolean refresh) This method may be used to indicate that a change in the field should cause a refresh event.void
setRejectedValue
(Serializable objValue) This method may be used to set the value that was not valid for the field.This method may be used to set the new value for the field.toString()
Methods inherited from class com.aquima.interactions.composer.model.Element
addPresentationStyle, evaluateTsl, getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, getVisibilityCondition, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setFocus, setParent, setPresentationStyle, setPresentationStyles, setPresentationStyles, setProperty, setReadonly, setReadonlyInheritFromParent, setRuntimeKey, setVisibilityCondition, setVisible
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.aquima.interactions.composer.IElement
getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setProperty
-
Constructor Details
-
Field
public Field(String name, DataType type, boolean multivalue, IMultilingualText questionText, IMultilingualText explainText) Constructs the field with the most common attributes.- Parameters:
name
- The name of the field (required). This is usually a full attribute name (entity.attribute).type
- The data type of the field (required).multivalue
- Boolean indicating if the field can hold multiple values.questionText
- The text that should be shown for the field (optional).explainText
- The text that should be shown as explanation for the field (optional).
-
Field
-
-
Method Details
-
duplicate
Description copied from interface:IElement
This method should clone the element and return the cloned element. The duplicate method should usually make a deep copy of the element, with the exception of members that are not mutable (and thus can safely be shared between multiple copies). The properties of an element are considered to be non-mutable, and will thus by default be copied. -
accept
Description copied from class:Element
This method will invoke the visitor for this runtime element. -
setRefresh
This method may be used to indicate that a change in the field should cause a refresh event.- Parameters:
refresh
- Boolean indicating if a change in the field value should cause a refresh event.- Returns:
- Pointer to this field element to allow method chaining.
-
isRefreshField
public boolean isRefreshField()Description copied from interface:IField
This method return a boolean indicating if a change in value should posted.- Specified by:
isRefreshField
in interfaceIField
- Returns:
- Boolean indicating if a change in the field should trigger a refresh action.
-
isRequired
public boolean isRequired()Description copied from interface:IField
This method will return true when the field is required.- Specified by:
isRequired
in interfaceIField
- Returns:
- boolean indicating if the field is required.
-
getDisplayLength
public int getDisplayLength()Description copied from interface:IField
This method return the maximum length for the field.- Specified by:
getDisplayLength
in interfaceIField
- Returns:
- The maximum length of the field, or -1 for unlimited.
-
setDisplayLength
This method may be used to indicate the maximum length of the field value.- Parameters:
length
- The maximum number of characters of the field value.- Returns:
- Pointer to this field element to allow method chaining.
-
getValue
Description copied from interface:IField
This method returns the value of the field. -
setValue
This method may be used to set the new value for the field. This method is used by the portal engine after processing an event to update the old page.- Parameters:
fieldValue
- The new value for the field.- Returns:
- Pointer to this field element to allow method chaining.
-
getDomain
Description copied from interface:IField
This method will return the set of values that are currently valid for this field. When the field is not restricted to a set of values, this method will return the value null. -
setDomain
This method may be used to set the values that are valid for this field.- Parameters:
values
- Array of values that are valid for this field.- Returns:
- Pointer to this field element to allow method chaining.
-
setDomain
This method may be used to set the values that are valid for this field.- Parameters:
domain
- The domain containing the values.- Returns:
- Pointer to this field element to allow method chaining.
-
setDomain
This method may be used to set the values that are valid for this field.- Parameters:
values
- Array of values that are valid for this field.- Returns:
- Pointer to this field element to allow method chaining.
-
getDomainValues
Description copied from interface:IField
This method will return the set of values that are available for this field. The method isCurrentlyValid of the returned values may be used to check if the value should be allowed to be chosen. When the field is not restricted to a set of values, this method will return the value null.- Specified by:
getDomainValues
in interfaceIField
- Returns:
- Array containing all the values that are allowed for this field.
-
addMessage
This method may be used to add a message to the field.- Parameters:
message
- The message that should be added.- Returns:
- Boolean indicating if the message was actually added (duplicate messages are ignored).
-
getMessages
Description copied from interface:IField
This method will return the error or waning messages applicable to this field. When there are no messages (either because there has not been a change yet, or the value is valid) this method will return an empty array.- Specified by:
getMessages
in interfaceIField
- Returns:
- Error and/or warning messages associated with the field.
-
setMessages
This method may be used to set messages for the field. The messages are usually set by the portal engine after the processing of an event has failed.- Parameters:
messages
- Array of messages for the field.- Returns:
- Pointer to this field element to allow method chaining.
-
getExplainText
Description copied from interface:IField
Get the explain text for this field.- Specified by:
getExplainText
in interfaceIField
- Returns:
- Text object containing an explanation of the field.
-
setExplainText
This method may be used to override the explain text for the field.- Parameters:
textValue
- The new explain text for the field.
-
getQuestionText
Description copied from interface:IField
Get the question text for this field. The question text is usually used in the interface instead of the name of the field.- Specified by:
getQuestionText
in interfaceIField
- Returns:
- Text object containing the question text of the field.
-
setQuestionText
This method may be used to override the question text for the field.- Parameters:
textValue
- The new question text for the field.
-
getDataType
Description copied from interface:IField
Returns the data type of the field.- Specified by:
getDataType
in interfaceIField
- Returns:
- The data type of the field.
-
isMultiValue
public boolean isMultiValue()Description copied from interface:IField
The cardinality of the field.- Specified by:
isMultiValue
in interfaceIField
- Returns:
- Boolean indicating if multiple values are allowed for this field.
-
setMultiValue
public void setMultiValue(boolean isMultiValued) This method may be used to override if multiple values are allowed for this field.- Parameters:
isMultiValued
- boolean indicating if multiple values are allowed for this field.
-
getRejectedValue
Description copied from interface:IField
This method will return the rejected value in case there are warnings or errors applicable to this field. When there is no rejected value this method will return a null pointer.- Specified by:
getRejectedValue
in interfaceIField
- Returns:
- The value of the field that did not pass the validation(s).
-
setRejectedValue
This method may be used to set the value that was not valid for the field. The rejected value is usually set by the portal engine after the processing of an event has failed due to a conversion or validation error.- Parameters:
objValue
- The value that was not valid for the field.
-
addValidation
This method may be used to add a validation to the field.- Parameters:
validation
- The validation that should be added.- Returns:
- Boolean indicating if the validation was successfully added.
-
getValidations
Description copied from interface:IField
This method returns the validations that are defined for this field. The validations may be performed at the client side (for instance using javascript), but will also be performed at the server side.- Specified by:
getValidations
in interfaceIField
- Returns:
- the validations that are defined for this field.
-
addParameter
-
getParameters
Description copied from interface:IField
Returns the evaluated parameters of this field.- Specified by:
getParameters
in interfaceIField
- Returns:
- an array containing the parameters of this field, may be empty but never null.
-
toString
-
equals
-
hashCode
public int hashCode()
-