Class RuleFieldExtractionUtility
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.module.provider.RuleFieldExtractionUtility
Commonality shared between
RuleFieldPersistenceProvider and RuleFieldValidator- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertDTOToMvelString(DataDTOToMVELTranslator translator, String entityKey, DataDTO dto, String fieldService) Takes a JSON string that came from the frontend form submission and deserializes it into itsDataWrapperdto representation so that it can be converted to an MVEL expressionconvertSimpleMatchRuleJsonToMvel(DataDTOToMVELTranslator translator, String entityKey, String fieldService, DataWrapper dw) Converts the givenDataWrapperinto an MVEL expressionconvertSimpleRuleToJson(MVELToDataWrapperTranslator translator, com.fasterxml.jackson.databind.ObjectMapper mapper, String matchRule, String jsonProp, String fieldService) Converts a simple MVEL rule into its JSON representation suitable for adding to anEntityto pass to the frontend.protected Stringprotected String
-
Field Details
-
ruleBuilderFieldServiceFactory
-
xssExploitProtectionEnabled
@Value("${exploitProtection.xssEnabled:false}") protected boolean xssExploitProtectionEnabled
-
-
Constructor Details
-
RuleFieldExtractionUtility
public RuleFieldExtractionUtility()
-
-
Method Details
-
convertJsonToDataWrapper
Takes a JSON string that came from the frontend form submission and deserializes it into itsDataWrapperdto representation so that it can be converted to an MVEL expression- Parameters:
json-- Returns:
-
convertSimpleMatchRuleJsonToMvel
public String convertSimpleMatchRuleJsonToMvel(DataDTOToMVELTranslator translator, String entityKey, String fieldService, DataWrapper dw) throws MVELTranslationException Converts the givenDataWrapperinto an MVEL expression- Parameters:
translator-entityKey-fieldService-dw-- Returns:
- Throws:
MVELTranslationException
-
convertDTOToMvelString
public String convertDTOToMvelString(DataDTOToMVELTranslator translator, String entityKey, DataDTO dto, String fieldService) throws MVELTranslationException - Throws:
MVELTranslationException
-
convertSimpleRuleToJson
public Property convertSimpleRuleToJson(MVELToDataWrapperTranslator translator, com.fasterxml.jackson.databind.ObjectMapper mapper, String matchRule, String jsonProp, String fieldService) Converts a simple MVEL rule into its JSON representation suitable for adding to anEntityto pass to the frontend.- Parameters:
translator-mapper-matchRule-jsonProp-fieldService-- Returns:
-
escapeSpecialCharacters
-
unescapeSpecialCharacters
-
populateSpecialCharactersMap
-