Class DefaultStringValueCodec
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.mapping.validation.rules.DefaultStringValueCodec
-
- All Implemented Interfaces:
StringValueCodec
,AutoCloseable
public class DefaultStringValueCodec extends Object implements StringValueCodec
Default implementation ofStringValueCodec
- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description DefaultStringValueCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Complete any resource allocated during codec usage.String
decodeValues(String encoded)
Replace all group labels with the original string literal value.String
encodeValues(String decoded)
Replace all string literal values in the decoded SPEL expression with a group label.
-
-
-
Method Detail
-
encodeValues
public String encodeValues(String decoded)
Description copied from interface:StringValueCodec
Replace all string literal values in the decoded SPEL expression with a group label.- Specified by:
encodeValues
in interfaceStringValueCodec
- Parameters:
decoded
- The original expression- Returns:
- The expression with string literals replaced with a group label
-
decodeValues
public String decodeValues(String encoded)
Description copied from interface:StringValueCodec
Replace all group labels with the original string literal value.- Specified by:
decodeValues
in interfaceStringValueCodec
- Parameters:
encoded
- The encoded SPEL expression previously returned by this instance of StringValueCodec.- Returns:
- The expression with group labels replaced by the original string literals
-
close
public void close()
Description copied from interface:StringValueCodec
Complete any resource allocated during codec usage. This is generally a good spot to assert that all original decoded values were accounted for during decoding.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStringValueCodec
-
-