Interface PolicyLookup
- All Known Implementing Classes:
DefaultPolicyLookup
public interface PolicyLookup
Defines a helper that returns the policy implementation (adjuster, converter or validator) from a form field
policy annotation (but not custom policies as these already refer to their implementing policy), returns the default
converter for a form field type, and adds/updates such lookup lists.
-
Method Summary
Modifier and TypeMethodDescriptionReturns all default collection converters in use and related metadata.<C extends CollectionConverter<?,T>, T>
InterceptorCommonLibrary.DefaultCollectionConverterEntry<T, C> getDefaultCollectionConverterEntry(Class<? extends T> itemClass) Returns default collection converter and related metadata for an item class of a collection form field, or null if not found.Returns all default converters in use and related metadata.<C extends Converter<?,T>, T>
InterceptorCommonLibrary.DefaultConverterEntry<T, C> getDefaultConverterEntry(Class<? extends T> fieldClass) Returns default converter and related metadata for a recipient type form field, or null if not found.Returns all policy classes and related metadata.<A extends Annotation,P extends Policy<A>, T>
InterceptorCommonLibrary.PolicyEntry<A, P, T> getPolicyEntry(Class<? extends A> annotationClass) Returns policy class and related metadata to be used for a form field annotation, or null if not found.<C extends CollectionConverter<?,T>, T>
InterceptorCommonLibrary.DefaultCollectionConverterEntry<T, ?> putDefaultCollectionConverter(Class<C> collectionConverterClass) Adds default collection converter so it can be found from its recipient type, returning description of any existing collection converter that was replaced.<C extends Converter<?,T>, T>
InterceptorCommonLibrary.DefaultConverterEntry<T, ?> putDefaultConverter(Class<C> converterClass) Adds default converter so it can be found from its recipient type, returning description of any existing converter that was replaced.<A extends Annotation,P extends Policy<A>, T>
InterceptorCommonLibrary.PolicyEntry<A, ?, ?> Adds policy class so it can be found from its annotation class, returning description of any existing policy that was replaced.<C extends CollectionConverter<?,T>, T>
InterceptorCommonLibrary.DefaultCollectionConverterEntry<T, C> removeDefaultCollectionConverter(Class<? extends T> itemClass) Removes default collection converter class from lookup, returning description of any existing converter that was removed.<C extends Converter<?,T>, T>
InterceptorCommonLibrary.DefaultConverterEntry<T, C> removeDefaultConverter(Class<? extends T> fieldClass) Removes default converter class from lookup, returning description of any existing converter that was removed.<A extends Annotation,P extends Policy<A>, T>
InterceptorCommonLibrary.PolicyEntry<A, P, T> removePolicy(Class<? extends A> annotationClass) Removes policy class from lookup, returning description of any existing policy that was removed.
-
Method Details
-
getDefaultCollectionConverterEntries
Collection<InterceptorCommonLibrary.DefaultCollectionConverterEntry<?,?>> getDefaultCollectionConverterEntries()Returns all default collection converters in use and related metadata. -
getDefaultCollectionConverterEntry
<C extends CollectionConverter<?,T>, InterceptorCommonLibrary.DefaultCollectionConverterEntry<T,T> C> getDefaultCollectionConverterEntry(Class<? extends T> itemClass) Returns default collection converter and related metadata for an item class of a collection form field, or null if not found. -
getDefaultConverterEntries
Collection<InterceptorCommonLibrary.DefaultConverterEntry<?,?>> getDefaultConverterEntries()Returns all default converters in use and related metadata. -
getDefaultConverterEntry
<C extends Converter<?,T>, InterceptorCommonLibrary.DefaultConverterEntry<T,T> C> getDefaultConverterEntry(Class<? extends T> fieldClass) Returns default converter and related metadata for a recipient type form field, or null if not found. -
getPolicyEntries
Collection<InterceptorCommonLibrary.PolicyEntry<?,?, getPolicyEntries()?>> Returns all policy classes and related metadata. -
getPolicyEntry
<A extends Annotation,P extends Policy<A>, InterceptorCommonLibrary.PolicyEntry<A,T> P, getPolicyEntryT> (Class<? extends A> annotationClass) Returns policy class and related metadata to be used for a form field annotation, or null if not found. Returns null for custom annotations as they already refer to their policy class. -
putDefaultCollectionConverter
<C extends CollectionConverter<?,T>, InterceptorCommonLibrary.DefaultCollectionConverterEntry<T,T> ?> putDefaultCollectionConverter(Class<C> collectionConverterClass) throws PolicyLookupRejectionException Adds default collection converter so it can be found from its recipient type, returning description of any existing collection converter that was replaced. ThrowsCustomPolicyNotApplicableExceptionif custom policy added. Implementations may throw similar exceptions to enforce their own rules.- Throws:
PolicyLookupRejectionException
-
putDefaultConverter
<C extends Converter<?,T>, InterceptorCommonLibrary.DefaultConverterEntry<T,T> ?> putDefaultConverter(Class<C> converterClass) throws PolicyLookupRejectionException Adds default converter so it can be found from its recipient type, returning description of any existing converter that was replaced. ThrowsCustomPolicyNotApplicableExceptionif custom policy added. Implementations may throw similar exceptions to enforce their own rules.- Throws:
PolicyLookupRejectionException
-
putPolicy
<A extends Annotation,P extends Policy<A>, InterceptorCommonLibrary.PolicyEntry<A,T> ?, putPolicy?> (Class<P> policyClass) throws PolicyLookupRejectionException Adds policy class so it can be found from its annotation class, returning description of any existing policy that was replaced. ThrowsCustomPolicyNotApplicableExceptionif custom policy added. Implementations may throw similar exceptions to enforce their own rules.- Throws:
PolicyLookupRejectionException
-
removeDefaultCollectionConverter
<C extends CollectionConverter<?,T>, InterceptorCommonLibrary.DefaultCollectionConverterEntry<T,T> C> removeDefaultCollectionConverter(Class<? extends T> itemClass) throws PolicyLookupRejectionException Removes default collection converter class from lookup, returning description of any existing converter that was removed. Implementations may throwPolicyLookupRejectionExceptionor subclasses to enforce their own rules.- Throws:
PolicyLookupRejectionException
-
removeDefaultConverter
<C extends Converter<?,T>, InterceptorCommonLibrary.DefaultConverterEntry<T,T> C> removeDefaultConverter(Class<? extends T> fieldClass) throws PolicyLookupRejectionException Removes default converter class from lookup, returning description of any existing converter that was removed. Implementations may throwPolicyLookupRejectionExceptionor subclasses to enforce their own rules.- Throws:
PolicyLookupRejectionException
-
removePolicy
<A extends Annotation,P extends Policy<A>, InterceptorCommonLibrary.PolicyEntry<A,T> P, removePolicyT> (Class<? extends A> annotationClass) throws PolicyLookupRejectionException Removes policy class from lookup, returning description of any existing policy that was removed. Implementations may throwPolicyLookupRejectionExceptionor subclasses to enforce their own rules.- Throws:
PolicyLookupRejectionException
-