Class QuestionValidator
java.lang.Object
ch.tocco.nice2.persist.core.api.validation.AbstractEntityValidator
ch.tocco.nice2.optional.evaluation.impl.validators.QuestionValidator
- All Implemented Interfaces:
EntitiesValidator
,EntityValidator
- Ensures, that only questions with a question type that allows answer options
actually has answer options attached.
- Check newly added relQuestion_parallel relations: Must not be to itself and connected Questions must be
related to the same Questionnaire
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(Entity question, EntityValidationResult validationResult) Validate the entity at hand.Methods inherited from class ch.tocco.nice2.persist.core.api.validation.AbstractEntityValidator
addMyself, getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.validation.EntityValidator
validate
-
Constructor Details
-
QuestionValidator
-
-
Method Details
-
validate
public void validate(Entity question, EntityValidationResult validationResult) throws PersistException Description copied from interface:EntityValidator
Validate the entity at hand.- Parameters:
question
- the entity to be validatedvalidationResult
- the EntityValidationResult to write the result of the validation to.EntityValidationResult
for more details on how to construct the EntityValidationResult.- Throws:
PersistException
-