ValidatorInterface

public interface ValidatorInterface

Validators should implement this interface

Validator

Methods

addCheck

void addCheck(CheckInterface checkInterface)

Adds validation checks to be enforced by a validator

Parameters:
  • checkInterface

addValidator

void addValidator(ValidatorInterface validatorInterface)

Add another validator to validated at the time this one is being validated.

Parameters:
  • validatorInterface – the validatorInterface object

clearErrors

void clearErrors()

Clear all the errors from the validator.

maybe use when you have already run the validation onces and want to run the validation again using the same ValidatorInterface instance

disableCheck

void disableCheck(CheckInterface checkInterface)

disable validation check

Parameters:
  • checkInterface – the validation check to disable.

disableValidator

void disableValidator(ValidatorInterface validatorInterface)

Disable the validator from being validated any more.

Parameters:
  • validatorInterface – validatorInterface object

getErrors

Map<String, List> getErrors()

Returns all error that the validator found as a HashMap. with the key being tags if your passed in any when creating the validator otherwise all errors afre returned under the tag NON_SPECIFIC

the value of the HashMap consists an ArrayList of errors that relate to each tag

Returns:Map

getErrorsByTag

List getErrorsByTag(String tag)

Gets a list of errors for a specific tag.

Parameters:
  • tag

validate

boolean validate()

Does the actual validation.

Returns:boolean true of valid

validate

void validate(ValidationListener validationListener)

Does the actual validation.

Parameters:
  • validationListener – listener that is