Class BLCFieldUtils

java.lang.Object
org.broadleafcommerce.common.util.BLCFieldUtils

public class BLCFieldUtils extends Object
Utility class used primarily for retrieving fields on domain classes. Retrieval will include searching in the inheritance hierarchy for the provided class. Retrieval will also honor traversal of multiple fields in the field name (delimited with a period).
Author:
Jeff Fischer
  • Field Details

    • FIELD_CACHE

      public static final Map<String,Object> FIELD_CACHE
    • NULL_FIELD

      public static final Object NULL_FIELD
    • includeUnqualifiedPolymorphicEntities

      protected boolean includeUnqualifiedPolymorphicEntities
    • useCache

      protected boolean useCache
    • entityConfiguration

      protected EntityConfiguration entityConfiguration
    • helper

      protected DynamicDaoHelper helper
  • Constructor Details

    • BLCFieldUtils

      public BLCFieldUtils(boolean includeUnqualifiedPolymorphicEntities, boolean useCache, EntityConfiguration entityConfiguration, DynamicDaoHelper helper)
      Initialize the utility with required resources
      Parameters:
      includeUnqualifiedPolymorphicEntities - include polymorphic variations that were excluded with AdminPresentationClass.excludeFromPolymorphism()
      useCache - use the polymorphic type list cache in DynamicDaoHelperImpl
      entityConfiguration - contains any explicitly defined entity types for the system
      helper - helper class for retrieving polymorphic types for a ceiling domain class
  • Method Details

    • getSingleField

      public static Field getSingleField(Class<?> clazz, String fieldName) throws IllegalStateException
      Retrieve the field for the class. This method will also look in superclasses.
      Parameters:
      clazz -
      fieldName -
      Returns:
      Throws:
      IllegalStateException
    • getField

      public Field getField(Class<?> clazz, String fieldName) throws IllegalStateException
      Retrieve the field for the class. This method will look in the entire inheritance hierarchy for the class (if applicable) and will also honor multiple field traversals in the fieldName using a period delimeter.
      Parameters:
      clazz -
      fieldName -
      Returns:
      Throws:
      IllegalStateException
    • getClassForField

      protected Class<?> getClassForField(DynamicDaoHelper helper, String token, Field field, Class<?>[] entities)