Package io.envoyproxy.pgv
Class ReflectiveValidatorIndex
java.lang.Object
io.envoyproxy.pgv.ReflectiveValidatorIndex
- All Implemented Interfaces:
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
Fields inherited from interface io.envoyproxy.pgv.ValidatorIndex
ALWAYS_INVALID, ALWAYS_VALID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Validator<T>validatorFor(Class clazz) Returns the validator for<T>, orALWAYS_VALIDif not found.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.envoyproxy.pgv.ValidatorIndex
validatorFor
-
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
-