Class PolicyValidator
java.lang.Object
de.fraunhofer.iese.mydata.policy.validation.PolicyValidator
- All Implemented Interfaces:
IPolicyValidator
,javax.validation.ConstraintValidator<MyDataPolicy,
String>
public class PolicyValidator
extends Object
implements IPolicyValidator, javax.validation.ConstraintValidator<MyDataPolicy,String>
The Class PolicyValidator.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(MyDataPolicy constraintAnnotation) Implementing this method is optional and is usually blank in example code.boolean
Use this method to test the constraint.void
validateLanguageVersion
(Policy policy) void
validateLanguageVersion
(String policyString) void
validatePolicySolutionAndComponents
(SolutionId solutionId, String policy) void
validateXMLSchema
(String policy)
-
Constructor Details
-
PolicyValidator
public PolicyValidator()
-
-
Method Details
-
validateXMLSchema
- Specified by:
validateXMLSchema
in interfaceIPolicyValidator
- Throws:
InvalidEntityException
-
validatePolicySolutionAndComponents
public void validatePolicySolutionAndComponents(SolutionId solutionId, String policy) throws InvalidEntityException - Specified by:
validatePolicySolutionAndComponents
in interfaceIPolicyValidator
- Throws:
InvalidEntityException
-
validateLanguageVersion
- Throws:
InvalidEntityException
-
validateLanguageVersion
- Throws:
InvalidEntityException
-
initialize
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<MyDataPolicy,
String> - See Also:
-
ConstraintValidator.initialize(java.lang.annotation.Annotation)
-
isValid
Use this method to test the constraint.- Specified by:
isValid
in interfacejavax.validation.ConstraintValidator<MyDataPolicy,
String> - See Also:
-
ConstraintValidator.isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
-