Class BLCFieldUtils
java.lang.Object
org.broadleafcommerce.common.util.BLCFieldUtils
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 Summary
FieldsModifier and TypeFieldDescriptionprotected EntityConfiguration
protected DynamicDaoHelper
protected boolean
static final Object
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionBLCFieldUtils
(boolean includeUnqualifiedPolymorphicEntities, boolean useCache, EntityConfiguration entityConfiguration, DynamicDaoHelper helper) Initialize the utility with required resources -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>
getClassForField
(DynamicDaoHelper helper, String token, Field field, Class<?>[] entities) Retrieve the field for the class.static Field
getSingleField
(Class<?> clazz, String fieldName) Retrieve the field for the class.
-
Field Details
-
FIELD_CACHE
-
NULL_FIELD
-
includeUnqualifiedPolymorphicEntities
protected boolean includeUnqualifiedPolymorphicEntities -
useCache
protected boolean useCache -
entityConfiguration
-
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 withAdminPresentationClass.excludeFromPolymorphism()
useCache
- use the polymorphic type list cache inDynamicDaoHelperImpl
entityConfiguration
- contains any explicitly defined entity types for the systemhelper
- helper class for retrieving polymorphic types for a ceiling domain class
-
-
Method Details
-
getSingleField
Retrieve the field for the class. This method will also look in superclasses.- Parameters:
clazz
-fieldName
-- Returns:
- Throws:
IllegalStateException
-
getField
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)
-