Class DataDTOToMVELTranslator
java.lang.Object
org.broadleafcommerce.openadmin.web.rulebuilder.DataDTOToMVELTranslator
Utility class to convert a DataDTO/ExpressionDTO into an MVEL string
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildCollectionExpression(StringBuffer sb, String entityKey, String field, Object[] value, SupportedFieldType type, SupportedFieldType secondaryType, String operator, boolean includeParenthesis, boolean isFieldComparison, boolean ignoreCase, boolean isNegation, boolean ignoreQuotes) protected voidbuildExpression(StringBuffer sb, String entityKey, String field, Object[] value, SupportedFieldType type, SupportedFieldType secondaryType, String operator, boolean includeParenthesis, boolean isFieldComparison, boolean ignoreCase, boolean isNegation, boolean ignoreQuotes) protected voidbuildExpression(ExpressionDTO expressionDTO, StringBuffer sb, String entityKey, BLCOperator operator, RuleBuilderFieldService fieldService) protected StringbuildFieldName(String entityKey, String fieldName) protected voidbuildMVEL(DataDTO dataDTO, StringBuffer sb, String entityKey, String groupOperator, RuleBuilderFieldService fieldService) createMVEL(String entityKey, DataDTO dataDTO, RuleBuilderFieldService fieldService) protected StringescapeInternalMiltyQuotes(String processedValue) protected StringescapeInternalQuotes(String processedValue) protected Object[]extractBasicValues(Object value) protected StringformatField(String entityKey, SupportedFieldType type, String field, boolean ignoreCase) protected StringformatValue(String fieldName, String entityKey, SupportedFieldType type, SupportedFieldType secondaryType, Object[] value, boolean isFieldComparison, boolean ignoreCase, boolean ignoreQuotes) booleanisProjection(Object value)
-
Field Details
-
CONTAINS_OPERATOR
- See Also:
-
STARTS_WITH_OPERATOR
- See Also:
-
ENDS_WITH_OPERATOR
- See Also:
-
EQUALS_OPERATOR
- See Also:
-
NOT_EQUALS_OPERATOR
- See Also:
-
GREATER_THAN_EQUALS_OPERATOR
- See Also:
-
LESS_THAN_EQUALS_OPERATOR
- See Also:
-
GREATER_THAN_OPERATOR
- See Also:
-
LESS_THAN_OPERATOR
- See Also:
-
COLLECTION_OPERATOR
- See Also:
-
SIZE_GREATER_THAN_OPERATOR
- See Also:
-
SIZE_GREATER_THAN_EQUALS_OPERATOR
- See Also:
-
SIZE_LESS_THAN_OPERATOR
- See Also:
-
SIZE_LESS_THAN_EQUALS_OPERATOR
- See Also:
-
SIZE_EQUALS_OPERATOR
- See Also:
-
ZERO_OPERATOR
- See Also:
-
OLD_CONTAINS_OPERATOR
- See Also:
-
OLD_STARTS_WITH_OPERATOR
- See Also:
-
OLD_ENDS_WITH_OPERATOR
- See Also:
-
-
Constructor Details
-
DataDTOToMVELTranslator
public DataDTOToMVELTranslator()
-
-
Method Details
-
createMVEL
public String createMVEL(String entityKey, DataDTO dataDTO, RuleBuilderFieldService fieldService) throws MVELTranslationException - Throws:
MVELTranslationException
-
buildMVEL
protected void buildMVEL(DataDTO dataDTO, StringBuffer sb, String entityKey, String groupOperator, RuleBuilderFieldService fieldService) throws MVELTranslationException - Throws:
MVELTranslationException
-
buildExpression
protected void buildExpression(ExpressionDTO expressionDTO, StringBuffer sb, String entityKey, BLCOperator operator, RuleBuilderFieldService fieldService) throws MVELTranslationException - Throws:
MVELTranslationException
-
extractBasicValues
-
escapeInternalQuotes
-
escapeInternalMiltyQuotes
-
isProjection
-
buildCollectionExpression
protected void buildCollectionExpression(StringBuffer sb, String entityKey, String field, Object[] value, SupportedFieldType type, SupportedFieldType secondaryType, String operator, boolean includeParenthesis, boolean isFieldComparison, boolean ignoreCase, boolean isNegation, boolean ignoreQuotes) throws MVELTranslationException - Throws:
MVELTranslationException
-
buildExpression
protected void buildExpression(StringBuffer sb, String entityKey, String field, Object[] value, SupportedFieldType type, SupportedFieldType secondaryType, String operator, boolean includeParenthesis, boolean isFieldComparison, boolean ignoreCase, boolean isNegation, boolean ignoreQuotes) throws MVELTranslationException - Throws:
MVELTranslationException
-
buildFieldName
-
formatField
protected String formatField(String entityKey, SupportedFieldType type, String field, boolean ignoreCase) -
formatValue
protected String formatValue(String fieldName, String entityKey, SupportedFieldType type, SupportedFieldType secondaryType, Object[] value, boolean isFieldComparison, boolean ignoreCase, boolean ignoreQuotes) throws MVELTranslationException - Throws:
MVELTranslationException
-