Class FilteringHelper

java.lang.Object
org.glassfish.jersey.message.filtering.spi.FilteringHelper

public final class FilteringHelper extends Object
SPI utility methods for entity filtering.
  • Field Details

    • EMPTY_ANNOTATIONS

      public static final Annotation[] EMPTY_ANNOTATIONS
      Empty annotation array.
    • ENTITY_CLASSES

      private static final ConcurrentMap<Type,Class<?>> ENTITY_CLASSES
  • Constructor Details

    • FilteringHelper

      private FilteringHelper()
      Prevent instantiation.
  • Method Details

    • filterableEntityClass

      public static boolean filterableEntityClass(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 matching java.*.
      Parameters:
      clazz - entity class to be examined.
      Returns:
      true whether the class is filterable, false otherwise.
    • getEntityClass

      public static Class<?> getEntityClass(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 Class<?> _getEntityClass(Type genericType)
      Note: This method was copied from MOXyJsonProvider.
    • getPropertyMethods

      public static Map<String,Method> getPropertyMethods(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 Set<String> getDefaultFilteringScope()
      Get a set containing default filtering scope.
      Returns:
      default filtering scope.