Class ValidatorCache
java.lang.Object
org.tentackle.validate.ValidatorCache
Holds all fixed validators cached for all classes.
All validators bound by an annotation are considered fixed and can be cached.
This is a singleton.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFieldValidators(Class<?> clazz) Gets all validators for all annotated fields or methods.
If an attribute is annotated both at the field and the (getter-)method level, the method gets precedence.getFieldValidators(Field field, Method method) Get validators for an annotated field and/or method.static ValidatorCacheThe singleton.getObjectValidators(Class<?> clazz) Gets all validators for an annotated class.voidInvalidates the cache.
-
Constructor Details
-
ValidatorCache
public ValidatorCache()Creates a validator cache.
-
-
Method Details
-
getInstance
-
invalidate
public void invalidate()Invalidates the cache. -
getFieldValidators
Gets all validators for all annotated fields or methods.
If an attribute is annotated both at the field and the (getter-)method level, the method gets precedence.- Parameters:
clazz- the class to inspect- Returns:
- the validators for this class and scope
-
getFieldValidators
-
getObjectValidators
-