Package eu.europa.ec.taxud.validation
Class ValidationContext
java.lang.Object
eu.europa.ec.taxud.validation.ValidationContext
ValidationContext stores ValidationError and any information useful for validation process.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidator(Validator validator) Add Validator for validation process.ReturnsValidationErrorlist raised during the validation process.Gets excluded rules.Gets failed cause.Return all information stored in the validation context.getProperty(String key) retrieve information form the validation context.Gets services injection.Return the list of applicable Validator.booleanisFailed()Is failed boolean.voidsetErrors(List<ValidationError> errors) Setter forValidationErrorError list.voidsetExcludedRules(Set<String> excludedRules) Sets excluded rules.voidsetProperty(String key, Object value) Store value in the validation context.voidsetServicesInjection(List<IServiceInject> servicesInjection) Sets services injection.voidsetValidationFailed(Exception error) Sets validation failed.
-
Constructor Details
-
ValidationContext
public ValidationContext()
-
-
Method Details
-
getErrors
ReturnsValidationErrorlist raised during the validation process.- Returns:
ValidationErrorlist.
-
setErrors
Setter forValidationErrorError list.- Parameters:
errors- List of validation erors.
-
getMessageProperties
Return all information stored in the validation context.- Returns:
- Map Information stored in the validation context.
-
setProperty
Store value in the validation context.- Parameters:
key- Property name.value- Property value.
-
getProperty
retrieve information form the validation context.- Parameters:
key- Property name to retrieve from context.- Returns:
- Object Value stored in the context.
-
getValidators
Return the list of applicable Validator.- Returns:
- List <Validator> List of validator linked to context.
-
addValidator
Add Validator for validation process.- Parameters:
validator- Validator to add to context.
-
getExcludedRules
Gets excluded rules.- Returns:
- the excluded rules
-
setExcludedRules
Sets excluded rules.- Parameters:
excludedRules- the excluded rules
-
getServicesInjection
Gets services injection.- Returns:
- the services injection
-
setServicesInjection
Sets services injection.- Parameters:
servicesInjection- the services injection
-
setValidationFailed
Sets validation failed.- Parameters:
error- the error
-
getFailedCause
Gets failed cause.- Returns:
- the failed cause
-
isFailed
public boolean isFailed()Is failed boolean.- Returns:
- the boolean
-