Interface StringValueCodec
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DefaultStringValueCodec
public interface StringValueCodec extends AutoCloseable
Codec responsible for encoding string literals in a SPEL expression with a easily replaceable label. The codec is also capable of decoding any encoded response it manufactures. The codec keeps track of the original decoded values. As such, this object is not thread safe and a new instance should be created for every usage. When decoding, it is not necessary to pass back the entire encoded string. Rather, it is acceptable to pass back in portions of the encoded string until the entire encoded string is accounted for.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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
String encodeValues(String decoded)
Replace all string literal values in the decoded SPEL expression with a group label.- Parameters:
decoded
- The original expression- Returns:
- The expression with string literals replaced with a group label
-
decodeValues
String decodeValues(String encoded)
Replace all group labels with the original string literal value.- 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
default void close()
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
-
-