Class TimerValidator
- java.lang.Object
-
- de.fraunhofer.iese.mydata.timer.validation.TimerValidator
-
- All Implemented Interfaces:
ITimerValidator
,javax.validation.ConstraintValidator<MyDataTimer,String>
public class TimerValidator extends Object implements ITimerValidator, javax.validation.ConstraintValidator<MyDataTimer,String>
The Class TimerValidator.
-
-
Constructor Summary
Constructors Constructor Description TimerValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(MyDataTimer constraintAnnotation)
Implementing this method is optional and is usually blank in example code.boolean
isValid(String value, javax.validation.ConstraintValidatorContext context)
Use this method to test the constraint.void
validateLanguageVersion(Timer timer)
void
validateTimerSolutionAndComponents(SolutionId solutionId, @NotNull String timer)
void
validateXMLSchema(String timer)
-
-
-
Method Detail
-
validateXMLSchema
public void validateXMLSchema(String timer) throws InvalidEntityException
- Specified by:
validateXMLSchema
in interfaceITimerValidator
- Throws:
InvalidEntityException
-
initialize
public void initialize(MyDataTimer constraintAnnotation)
Implementing this method is optional and is usually blank in example code. Use it to setup your constraint validator. In this case, I've created a Pattern object to test the post code.- Specified by:
initialize
in interfacejavax.validation.ConstraintValidator<MyDataTimer,String>
- See Also:
ConstraintValidator.initialize(java.lang.annotation.Annotation)
-
isValid
public boolean isValid(String value, javax.validation.ConstraintValidatorContext context)
Use this method to test the constraint.- Specified by:
isValid
in interfacejavax.validation.ConstraintValidator<MyDataTimer,String>
- See Also:
ConstraintValidator.isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
-
validateTimerSolutionAndComponents
public void validateTimerSolutionAndComponents(SolutionId solutionId, @NotNull @NotNull String timer) throws InvalidEntityException
- Specified by:
validateTimerSolutionAndComponents
in interfaceITimerValidator
- Throws:
InvalidEntityException
-
validateLanguageVersion
public void validateLanguageVersion(Timer timer) throws InvalidEntityException
- Throws:
InvalidEntityException
-
-