Class DefaultStringValueCodec
java.lang.Object
com.broadleafcommerce.data.tracking.core.mapping.validation.rules.DefaultStringValueCodec
- All Implemented Interfaces:
StringValueCodec
,AutoCloseable
Default implementation of
StringValueCodec
- Author:
- Jeff Fischer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Complete any resource allocated during codec usage.decodeValues
(String encoded) Replace all group labels with the original string literal value.encodeValues
(String decoded) Replace all string literal values in the decoded SPEL expression with a group label.
-
Constructor Details
-
DefaultStringValueCodec
public DefaultStringValueCodec()
-
-
Method Details
-
encodeValues
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
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
-