Class CombiningValidator<T>

java.lang.Object
com.sap.cloud.security.token.validation.CombiningValidator<T>
Type Parameters:
T - the type to be validated.
All Implemented Interfaces:
Validator<T>

public class CombiningValidator<T> extends Object implements Validator<T>
This is a special validator that combines several validators into one. By default the validation stops after one invalid result has been found.
  • Constructor Details

    • CombiningValidator

      public CombiningValidator(List<Validator<T>> validators)
    • CombiningValidator

      public CombiningValidator(Validator<T>... validators)
  • Method Details

    • validate

      public ValidationResult validate(T t)
      Description copied from interface: Validator
      Validates the given object.
      Specified by:
      validate in interface Validator<T>
      Parameters:
      t - the object of type Validator to be validated.
      Returns:
      the validation result as ValidationResult.
    • getValidators

      public List<Validator<T>> getValidators()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • registerValidationListener

      public void registerValidationListener(ValidationListener validationListener)
      Components that are interested in the result of the token validation can register a validation listener which is called whenever a token is validated. Listener must implement the ValidationListener interface.
      Parameters:
      validationListener - the listener to be added.
    • removeValidationListener

      public void removeValidationListener(ValidationListener validationListener)
      Use this method to remove a registered listener so that it is not called anymore.
      Parameters:
      validationListener - the listener to be removed.