Class ReflectionUtils

java.lang.Object
de.hybris.platform.webservicescommons.jaxb.util.ReflectionUtils

public final class ReflectionUtils extends Object
Helper class focusing on extracting data from fields. Mainly used by moxy context factory.
  • Method Details

    • extractTypes

      public static Collection<Class> extractTypes(Field field)
      Extract actual base types used to define this field.

      for example:

      • List<String> will return String
      • Map<String,Integer> will return String, Integer
      Parameters:
      field - field to process
      Returns:
      Base types used to construct this field
    • extractActualType

      public static Collection<Class> extractActualType(Type... types)
      Extract actual base classes used to construct given types
      Parameters:
      types -
      Returns:
      Collection of actual base classes from given types
    • getArrayType

      public static Class getArrayType(Class clazz)
      Removes array property from given class.
      Parameters:
      clazz -
      Returns:
      Base class of given array
    • getAllFields

      public static Collection<Field> getAllFields(Class<?> clazz)
      Retrieves all fields (also private) from given class and its superclass. Up to Object level which properties are ignored.
      Parameters:
      clazz -
      Returns:
      Collection of fields declared in class