Class FieldDefinition
java.lang.Object
com.aquima.interactions.composer.model.definition.ElementDefinition
com.aquima.interactions.composer.model.definition.FieldDefinition
- All Implemented Interfaces:
IElementDefinition
,Serializable
This class holds the definition of a field.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FieldDefinition
(FieldDefinition other) protected
FieldDefinition
(IProject project, IParserFactory factory, IFieldDS datasource) protected
FieldDefinition
(String name, DataType type, IDynamicText questionText, IDynamicText explainText) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addParameterValue
(GlobalParameterValueDefinition parameter) protected void
addValidation
(FieldValidationDefinition validation) boolean
This method returns the attribute the field is defined for.This method returns the type of the field.This method returns the text object that should be used as explanation for this field.getName()
This method returns the name of the element definition.getParameter
(String parameterName) Returns the parameter value definition for the parameter with the given name, or null if no parameter with the given name exists.Returns the parameter value definitions of this field.This method returns the text object that should be used as question text for this field.getType()
This method returns the type of the element.This method returns an array containing all the validations that are defined for this field.int
hashCode()
boolean
hasParameter
(String parameterName, GlobalParameterType parameterType) Indicates whether this field has a parameter value definition for a parameter with the given name and type.boolean
This method returns a boolean indicating if the field supports multiple values.toString()
protected FieldDefinition
updateWith
(FieldDefinition definition) Methods inherited from class com.aquima.interactions.composer.model.definition.ElementDefinition
getPresentationStyles, isInternalDefinition, setInternalDefinition, setPresentationStyles
-
Constructor Details
-
FieldDefinition
protected FieldDefinition(String name, DataType type, IDynamicText questionText, IDynamicText explainText) -
FieldDefinition
-
FieldDefinition
-
-
Method Details
-
updateWith
-
getName
Description copied from interface:IElementDefinition
This method returns the name of the element definition. The name can be empty for element definitions that can not be retrieved by name, these elements can only be used via an inline reference.- Specified by:
getName
in interfaceIElementDefinition
- Overrides:
getName
in classElementDefinition
- Returns:
- The name of the element definition, can be null.
-
getType
Description copied from interface:IElementDefinition
This method returns the type of the element.- Returns:
- The type of the element the definition represents.
-
getAttribute
This method returns the attribute the field is defined for. For custom fields, the attribute may not be defined, and thus the method may return null.- Returns:
- the attribute the field is defined for.
-
getDataType
This method returns the type of the field.- Returns:
- the type of the field.
-
isMultivalue
public boolean isMultivalue()This method returns a boolean indicating if the field supports multiple values.- Returns:
- a boolean indicating if the field supports multiple values.
-
getExplainText
This method returns the text object that should be used as explanation for this field.- Returns:
- the text object that should be used as explanation for this field.
-
getQuestionText
This method returns the text object that should be used as question text for this field.- Returns:
- the text object that should be used as question text for this field.
-
addValidation
-
getValidations
This method returns an array containing all the validations that are defined for this field.- Returns:
- array containing all the validations that are defined for this field.
-
addParameterValue
-
getParameters
Returns the parameter value definitions of this field.- Returns:
- an array containing the parameter value definitions, may be empty but never null.
-
getParameter
Returns the parameter value definition for the parameter with the given name, or null if no parameter with the given name exists.- Parameters:
parameterName
- the name of the parameter- Returns:
- the parameter value definition or null
-
hasParameter
Indicates whether this field has a parameter value definition for a parameter with the given name and type.- Parameters:
parameterName
- the name of the parameterparameterType
- the type of the parameter- Returns:
- true if a parameter value definition with the given name and type exists, false otherwise.
-
equals
- Overrides:
equals
in classElementDefinition
-
hashCode
public int hashCode()- Overrides:
hashCode
in classElementDefinition
-
toString
-