Class FilteringHelper
- java.lang.Object
-
- org.glassfish.jersey.message.filtering.spi.FilteringHelper
-
public final class FilteringHelper extends java.lang.Object
SPI utility methods for entity filtering.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.annotation.Annotation[]
EMPTY_ANNOTATIONS
Empty annotation array.private static java.util.concurrent.ConcurrentMap<java.lang.reflect.Type,java.lang.Class<?>>
ENTITY_CLASSES
-
Constructor Summary
Constructors Modifier Constructor Description private
FilteringHelper()
Prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.Class<?>
_getEntityClass(java.lang.reflect.Type genericType)
Note: This method was copied fromMOXyJsonProvider
.static boolean
filterableEntityClass(java.lang.Class<?> clazz)
Determine whether given class is filterable by entity-filtering.static java.util.Set<java.lang.String>
getDefaultFilteringScope()
Get a set containing default filtering scope.static java.lang.Class<?>
getEntityClass(java.lang.reflect.Type genericType)
A convenience method to get the domain class (i.e.static java.util.Map<java.lang.String,java.lang.reflect.Method>
getPropertyMethods(java.lang.Class<?> clazz, boolean isGetter)
Get accessor method mappings (field -> getter/setter) for given class.
-
-
-
Method Detail
-
filterableEntityClass
public static boolean filterableEntityClass(java.lang.Class<?> clazz)
Determine whether given class is filterable by entity-filtering. Filterable classes are all classes that are not primitives and are not in a package matchingjava.*
.- Parameters:
clazz
- entity class to be examined.- Returns:
true
whether the class is filterable,false otherwise
.
-
getEntityClass
public static java.lang.Class<?> getEntityClass(java.lang.reflect.Type genericType)
A convenience method to get the domain class (i.e. Customer) from the generic type (i.e. Customer, List<Customer>, JAXBElement<Customer>, JAXBElement<? extends Customer>, List<JAXBElement<Customer>>, or List<JAXBElement<? extends Customer>>).- Parameters:
genericType
- type to obtain entity domain class for.- Returns:
- entity domain class.
-
_getEntityClass
private static java.lang.Class<?> _getEntityClass(java.lang.reflect.Type genericType)
Note: This method was copied fromMOXyJsonProvider
.
-
getPropertyMethods
public static java.util.Map<java.lang.String,java.lang.reflect.Method> getPropertyMethods(java.lang.Class<?> clazz, boolean isGetter)
Get accessor method mappings (field -> getter/setter) for given class.- Parameters:
clazz
- entity class to obtain property methods for.isGetter
- flag determining whether to look for getters or setters.- Returns:
- non-null map of field-accessor mappings.
-
getDefaultFilteringScope
public static java.util.Set<java.lang.String> getDefaultFilteringScope()
Get a set containing default filtering scope.- Returns:
- default filtering scope.
-
-