Package io.envoyproxy.pgv
Class ReflectiveValidatorIndex
java.lang.Object
io.envoyproxy.pgv.ReflectiveValidatorIndex
- All Implemented Interfaces:
ValidatorIndex
public final class ReflectiveValidatorIndex extends Object implements ValidatorIndex
ReflectiveValidatorIndex uses reflection to discover Validator implementations lazily the first
time a type is validated. If no validator can be found for type, a fallback validator
will be used (default ALWAYS_VALID).-
Field Summary
-
Constructor Summary
Constructors Constructor Description ReflectiveValidatorIndex()ReflectiveValidatorIndex(ValidatorIndex fallbackIndex) -
Method Summary
Modifier and Type Method Description <T> Validator<T>validatorFor(Class clazz)Returns the validator for<T>, orALWAYS_VALIDif not found.
-
Constructor Details
-
ReflectiveValidatorIndex
public ReflectiveValidatorIndex() -
ReflectiveValidatorIndex
- Parameters:
fallbackIndex- aValidatorIndeximplementation to use if reflective validator discovery fails.
-
-
Method Details
-
validatorFor
Returns the validator for<T>, orALWAYS_VALIDif not found.- Specified by:
validatorForin interfaceValidatorIndex
-