Class DefaultRuleParameterValueConverter
- java.lang.Object
-
- de.hybris.platform.ruleengineservices.rule.strategies.impl.DefaultRuleParameterValueConverter
-
- All Implemented Interfaces:
RuleParameterValueConverter,org.springframework.beans.factory.InitializingBean
public class DefaultRuleParameterValueConverter extends java.lang.Object implements RuleParameterValueConverter, org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.regex.PatternENUM_PATTERNprotected static java.util.regex.PatternLIST_PATTERNprotected static java.util.regex.PatternMAP_PATTERN
-
Constructor Summary
Constructors Constructor Description DefaultRuleParameterValueConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidconfigureAttributes(java.util.Map<java.lang.Object,java.lang.Object> attributes)protected voidconfigureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)java.lang.ObjectfromString(java.lang.String value, java.lang.String type)Converts from String to the required type.protected java.lang.Class<?>getClassForType(java.lang.String type)protected com.fasterxml.jackson.databind.ObjectReadergetObjectReader()protected com.fasterxml.jackson.databind.ObjectWritergetObjectWriter()RuleParameterTypeFormattergetRuleParameterTypeFormatter()java.util.Set<java.lang.String>getSupportedTypes()booleanisDebugMode()protected com.fasterxml.jackson.databind.JavaTyperesolveJavaType(com.fasterxml.jackson.databind.type.TypeFactory typeFactory, java.lang.String type)voidsetDebugMode(boolean debugMode)voidsetRuleParameterTypeFormatter(RuleParameterTypeFormatter ruleParameterTypeFormatter)voidsetSupportedTypes(java.util.Set<java.lang.String> supportedTypes)java.lang.StringtoString(java.lang.Object value)Converts from the required type to String.
-
-
-
Method Detail
-
getSupportedTypes
public java.util.Set<java.lang.String> getSupportedTypes()
-
setSupportedTypes
public void setSupportedTypes(java.util.Set<java.lang.String> supportedTypes)
-
getRuleParameterTypeFormatter
public RuleParameterTypeFormatter getRuleParameterTypeFormatter()
-
setRuleParameterTypeFormatter
public void setRuleParameterTypeFormatter(RuleParameterTypeFormatter ruleParameterTypeFormatter)
-
isDebugMode
public boolean isDebugMode()
-
setDebugMode
public void setDebugMode(boolean debugMode)
-
getObjectReader
protected com.fasterxml.jackson.databind.ObjectReader getObjectReader()
-
getObjectWriter
protected com.fasterxml.jackson.databind.ObjectWriter getObjectWriter()
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
configureObjectMapper
protected void configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
configureAttributes
protected void configureAttributes(java.util.Map<java.lang.Object,java.lang.Object> attributes)
-
toString
public java.lang.String toString(java.lang.Object value)
Description copied from interface:RuleParameterValueConverterConverts from the required type to String.- Specified by:
toStringin interfaceRuleParameterValueConverter- Parameters:
value- - the value to be converted to string- Returns:
- the required type converted to String
-
fromString
public java.lang.Object fromString(java.lang.String value, java.lang.String type)Description copied from interface:RuleParameterValueConverterConverts from String to the required type.- Specified by:
fromStringin interfaceRuleParameterValueConverter- Parameters:
value- - the string value to be converted- Returns:
- the converted value from string to the required type
-
resolveJavaType
protected com.fasterxml.jackson.databind.JavaType resolveJavaType(com.fasterxml.jackson.databind.type.TypeFactory typeFactory, java.lang.String type) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
getClassForType
protected java.lang.Class<?> getClassForType(java.lang.String type) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
-