Package org.apache.bval.jsr.resolver
Class CachingTraversableResolver
- java.lang.Object
-
- org.apache.bval.jsr.resolver.CachingTraversableResolver
-
- All Implemented Interfaces:
jakarta.validation.TraversableResolver
,CachingRelevant
public class CachingTraversableResolver extends Object implements jakarta.validation.TraversableResolver, CachingRelevant
Cache results of a delegated traversable resovler to optimize calls It works only for a single validate* call and should not be used if the TraversableResolver is accessed concurrently Date: 25.11.2009
Time: 13:56:18- Author:
- Roman Stumm (based on the code of Emmanuel Bernard)
-
-
Constructor Summary
Constructors Constructor Description CachingTraversableResolver(jakarta.validation.TraversableResolver delegate)
Create a new CachingTraversableResolver instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static jakarta.validation.TraversableResolver
cacheFor(jakarta.validation.TraversableResolver traversableResolver)
If necessary, return a caching wrapper for the specifiedTraversableResolver
.boolean
isCascadable(Object traversableObject, jakarta.validation.Path.Node traversableProperty, Class<?> rootBeanType, jakarta.validation.Path pathToTraversableObject, ElementType elementType)
boolean
isReachable(Object traversableObject, jakarta.validation.Path.Node traversableProperty, Class<?> rootBeanType, jakarta.validation.Path pathToTraversableObject, ElementType elementType)
boolean
needsCaching()
Learn whether the results of theTraversableResolver
should be cached.static boolean
needsCaching(jakarta.validation.TraversableResolver resolver)
Convenience method to check whether caching is necessary on a givenTraversableResolver
.
-
-
-
Method Detail
-
needsCaching
public static boolean needsCaching(jakarta.validation.TraversableResolver resolver)
Convenience method to check whether caching is necessary on a givenTraversableResolver
.- Parameters:
resolver
- to check- Returns:
- true when a CachingTraversableResolver is to be used during validation
-
cacheFor
public static jakarta.validation.TraversableResolver cacheFor(jakarta.validation.TraversableResolver traversableResolver)
If necessary, return a caching wrapper for the specifiedTraversableResolver
.- Parameters:
traversableResolver
-- Returns:
TraversableResolver
- See Also:
needsCaching(TraversableResolver)
-
isReachable
public boolean isReachable(Object traversableObject, jakarta.validation.Path.Node traversableProperty, Class<?> rootBeanType, jakarta.validation.Path pathToTraversableObject, ElementType elementType)
- Specified by:
isReachable
in interfacejakarta.validation.TraversableResolver
-
isCascadable
public boolean isCascadable(Object traversableObject, jakarta.validation.Path.Node traversableProperty, Class<?> rootBeanType, jakarta.validation.Path pathToTraversableObject, ElementType elementType)
- Specified by:
isCascadable
in interfacejakarta.validation.TraversableResolver
-
needsCaching
public boolean needsCaching()
Learn whether the results of theTraversableResolver
should be cached.- Specified by:
needsCaching
in interfaceCachingRelevant
- Returns:
- boolean
-
-