Interface MandatoryAwareFormQuestionType
- All Known Implementing Classes:
AbstractFormQuestionType
,CheckBoxQuestionType
,ChoicesListQuestionType
,DateTimeQuestionType
,FileQuestionType
,MatrixQuestionType
,NumberQuestionType
,SimpleTextQuestionType
,TextAreaQuestionType
public interface MandatoryAwareFormQuestionType
Provide all the necessary method to make a question type required or not
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ModelItem
Get the model item to add to the model items return by the method FormQuestionType.getModeldefault Validator
getMandatoryValidator
(FormQuestion question) Create a validator that should be added to the element definition return by FormQuestionType.getEntryModeldefault ViewElement
getMandatoryViewElement
(Model model) Create a view element to add in the view elements returned by FormQuestionType.getViewdefault boolean
isMandatory
(FormQuestion question) Check if the question is actually mandatory
-
Field Details
-
ATTRIBUTE_MANDATORY
Constant for mandatory attribute.- See Also:
-
-
Method Details
-
getMandatoryModelItem
Get the model item to add to the model items return by the method FormQuestionType.getModel- Returns:
- the model item
-
getMandatoryViewElement
Create a view element to add in the view elements returned by FormQuestionType.getView- Parameters:
model
- the model link to the view- Returns:
- a view element
-
getMandatoryValidator
Create a validator that should be added to the element definition return by FormQuestionType.getEntryModel- Parameters:
question
- the question- Returns:
- a validator
-
isMandatory
Check if the question is actually mandatory- Parameters:
question
- the question to check- Returns:
- true if the question is mandatory
-