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 Summary
Constructors Constructor Description CombiningValidator(Validator<T>... validators)CombiningValidator(List<Validator<T>> validators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Validator<T>>getValidators()voidregisterValidationListener(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.voidremoveValidationListener(ValidationListener validationListener)Use this method to remove a registered listener so that it is not called anymore.StringtoString()ValidationResultvalidate(T t)Validates the given object.
-
-
-
Method Detail
-
validate
public ValidationResult validate(T t)
Description copied from interface:ValidatorValidates the given object.- Specified by:
validatein interfaceValidator<T>- Parameters:
t- the object of typeValidatorto be validated.- Returns:
- the validation result as
ValidationResult.
-
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 theValidationListenerinterface.- 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.
-
-