@Component(value="blRuleFieldPersistenceProvider") @Scope(value="prototype") public class RuleFieldPersistenceProvider extends FieldPersistenceProviderAdapter
| Modifier and Type | Field and Description |
|---|---|
protected RuleFieldPersistenceProviderCascadeExtensionManager |
cascadeExtensionManager |
protected RuleFieldPersistenceProviderExtensionManager |
extensionManager |
protected RuleBuilderFieldServiceFactory |
ruleBuilderFieldServiceFactory |
protected RuleFieldExtractionUtility |
ruleFieldExtractionUtility |
protected SandBoxHelper |
sandBoxHelper |
| Constructor and Description |
|---|
RuleFieldPersistenceProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canHandleExtraction(ExtractValueRequest extractValueRequest,
Property property) |
protected boolean |
canHandlePersistence(PopulateValueRequest populateValueRequest,
Serializable instance) |
protected Property |
convertQuantityBasedRuleToJson(MVELToDataWrapperTranslator translator,
com.fasterxml.jackson.databind.ObjectMapper mapper,
Collection<QuantityBasedRule> quantityBasedRules,
String jsonProp,
String fieldService) |
protected Property |
convertSimpleRuleToJson(MVELToDataWrapperTranslator translator,
com.fasterxml.jackson.databind.ObjectMapper mapper,
SimpleRule simpleRule,
String jsonProp,
String fieldService) |
protected Object |
extractParent(PopulateValueRequest populateValueRequest,
Serializable instance)
This method is intended to find the object that the field is supposed to be populated on.
|
protected void |
extractQuantityRule(ExtractValueRequest extractValueRequest,
com.fasterxml.jackson.databind.ObjectMapper mapper,
MVELToDataWrapperTranslator translator) |
protected void |
extractSimpleRule(ExtractValueRequest extractValueRequest,
Property property,
com.fasterxml.jackson.databind.ObjectMapper mapper,
MVELToDataWrapperTranslator translator) |
MetadataProviderResponse |
extractValue(ExtractValueRequest extractValueRequest,
Property property)
Retrieve the property value from the requestedValue field from the request.
|
MetadataProviderResponse |
filterProperties(AddFilterPropertiesRequest addFilterPropertiesRequest,
Map<String,FieldMetadata> properties)
Filter the list of properties posted by the admin during and add or update.
|
static Object |
findContainedRuleIfApplicable(Object rule) |
protected Long |
getContainedRuleId(SimpleRule simpleRule,
javax.persistence.EntityManager em) |
int |
getOrder() |
protected Long |
getRuleId(SimpleRule rule,
javax.persistence.EntityManager em) |
protected Class<?> |
getStartingValueType(PopulateValueRequest populateValueRequest) |
protected boolean |
isEmbeddable(Class<?> clazz)
This method is responsible for determining whether the class is embeddable.
|
protected String |
parseParentProperty(String propertyName) |
protected boolean |
populateQuantityRule(PopulateValueRequest populateValueRequest,
Serializable instance) |
protected boolean |
populateSimpleRule(PopulateValueRequest populateValueRequest,
Serializable instance) |
MetadataProviderResponse |
populateValue(PopulateValueRequest populateValueRequest,
Serializable instance)
Set the property value on the target object.
|
protected Object |
recursivelyExtractParent(PopulateValueRequest populateValueRequest,
Serializable instance)
This method is responsible for recursively tracing the properties parents to find the correct parent to apply
the field update to.
|
protected Long |
transformId(Long id,
Object rule) |
protected boolean |
updateQuantityRule(javax.persistence.EntityManager em,
DataDTOToMVELTranslator translator,
String entityKey,
String fieldService,
String jsonPropertyValue,
Collection<QuantityBasedRule> criteriaList,
Class<?> memberType,
Object parent,
String mappedBy,
Property property) |
protected void |
updateSimpleRule(PopulateValueRequest populateValueRequest,
String mvel,
boolean persist,
SimpleRule rule) |
addSearchMapping, checkDirtyState, isFieldDirty, setNonDisplayableValuesalwaysRun, buildFieldInfo, canHandlePopulateNull, getListFieldType, getMapFieldTypeprotected RuleBuilderFieldServiceFactory ruleBuilderFieldServiceFactory
protected SandBoxHelper sandBoxHelper
protected RuleFieldExtractionUtility ruleFieldExtractionUtility
protected RuleFieldPersistenceProviderExtensionManager extensionManager
protected RuleFieldPersistenceProviderCascadeExtensionManager cascadeExtensionManager
protected boolean canHandlePersistence(PopulateValueRequest populateValueRequest, Serializable instance)
protected boolean canHandleExtraction(ExtractValueRequest extractValueRequest, Property property)
public MetadataProviderResponse populateValue(PopulateValueRequest populateValueRequest, Serializable instance) throws PersistenceException
FieldPersistenceProviderpopulateValue in interface FieldPersistenceProviderpopulateValue in class FieldPersistenceProviderAdapterpopulateValueRequest - contains the requested value and support classes.instance - the persistence entity instance on which to set the value harvested from the requestPersistenceExceptionpublic MetadataProviderResponse extractValue(ExtractValueRequest extractValueRequest, Property property) throws PersistenceException
FieldPersistenceProviderextractValue in interface FieldPersistenceProviderextractValue in class FieldPersistenceProviderAdapterextractValueRequest - contains the requested value and support classes.property - the property for the admin that will contain the information harvested from the persistence valuePersistenceExceptionpublic MetadataProviderResponse filterProperties(AddFilterPropertiesRequest addFilterPropertiesRequest, Map<String,FieldMetadata> properties)
FieldPersistenceProviderfilterProperties in interface FieldPersistenceProviderfilterProperties in class FieldPersistenceProviderAdapteraddFilterPropertiesRequest - contains the Entity instance.properties - the collection of properties to filterprotected void extractSimpleRule(ExtractValueRequest extractValueRequest, Property property, com.fasterxml.jackson.databind.ObjectMapper mapper, MVELToDataWrapperTranslator translator)
protected void extractQuantityRule(ExtractValueRequest extractValueRequest, com.fasterxml.jackson.databind.ObjectMapper mapper, MVELToDataWrapperTranslator translator)
protected boolean populateSimpleRule(PopulateValueRequest populateValueRequest, Serializable instance) throws Exception
Exceptionprotected Long getRuleId(SimpleRule rule, javax.persistence.EntityManager em)
protected Long getContainedRuleId(SimpleRule simpleRule, javax.persistence.EntityManager em)
protected Object extractParent(PopulateValueRequest populateValueRequest, Serializable instance) throws IllegalAccessException, FieldNotAvailableException
Embeddable as the proper parent for these
fields is the object itself and not the embedded object.populateValueRequest - the PopulateValueRequestinstance - the Object we are populating field values onPopulateValueRequestIllegalAccessExceptionFieldNotAvailableExceptionprotected Object recursivelyExtractParent(PopulateValueRequest populateValueRequest, Serializable instance) throws FieldNotAvailableException, IllegalAccessException
populateValueRequest - the populate value requestinstance - the entity that to populate a field value onFieldNotAvailableExceptionIllegalAccessExceptionprotected boolean isEmbeddable(Class<?> clazz)
clazz - the parent class of the populate value requestprotected boolean populateQuantityRule(PopulateValueRequest populateValueRequest, Serializable instance) throws FieldNotAvailableException, IllegalAccessException
protected Property convertSimpleRuleToJson(MVELToDataWrapperTranslator translator, com.fasterxml.jackson.databind.ObjectMapper mapper, SimpleRule simpleRule, String jsonProp, String fieldService)
protected Property convertQuantityBasedRuleToJson(MVELToDataWrapperTranslator translator, com.fasterxml.jackson.databind.ObjectMapper mapper, Collection<QuantityBasedRule> quantityBasedRules, String jsonProp, String fieldService)
protected boolean updateQuantityRule(javax.persistence.EntityManager em,
DataDTOToMVELTranslator translator,
String entityKey,
String fieldService,
String jsonPropertyValue,
Collection<QuantityBasedRule> criteriaList,
Class<?> memberType,
Object parent,
String mappedBy,
Property property)
protected void updateSimpleRule(PopulateValueRequest populateValueRequest, String mvel, boolean persist, SimpleRule rule) throws IllegalAccessException, FieldNotAvailableException
protected Class<?> getStartingValueType(PopulateValueRequest populateValueRequest) throws ClassNotFoundException, IllegalAccessException
public int getOrder()
getOrder in interface org.springframework.core.OrderedgetOrder in class FieldPersistenceProviderAdapterCopyright © 2023. All rights reserved.