public class HexSequenceConfiguredReplacementSource extends AbstractReplacementSource
ReplacementSource
implementation which assumes that the value is a byte sequence represented as a sequence of hexadecimal
numbers (2 characters per byte).
Used with FindAndReplaceService
to replace text in the message; for instance if one of the values from
FindAndReplaceService.getFindAndReplaceUnits()
is 0d0a then this will generate an actual replacement value of carriage
return linefeed.
In most cases you will be using ConfiguredReplacementSource
, however there may be times when the replacement value cannot
be described as part of an XML configuration (for instance the 'vertical tab' character, 0x0B, is generally considered invalid
depending on the version of the XML standard).
In the adapter configuration file this class is aliased as hex-sequence-configured-replacement-source which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
HexSequenceConfiguredReplacementSource() |
HexSequenceConfiguredReplacementSource(java.lang.String charset) |
HexSequenceConfiguredReplacementSource(java.lang.String value,
java.lang.String charset) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCharset() |
java.lang.String |
obtainValue(AdaptrisMessage msg)
Obtains a replacement value for
FindAndReplaceService based on the passed configured value. |
void |
setCharset(java.lang.String charset)
Set the character set to be used when converting the hexadecimal byte sequence into a string.
|
getValue, setValue
public HexSequenceConfiguredReplacementSource()
public HexSequenceConfiguredReplacementSource(java.lang.String charset)
public HexSequenceConfiguredReplacementSource(java.lang.String value, java.lang.String charset)
public java.lang.String obtainValue(AdaptrisMessage msg) throws ServiceException
ReplacementSource
Obtains a replacement value for FindAndReplaceService
based on the passed configured value.
msg
- the AdaptrisMessage
being processedServiceException
public java.lang.String getCharset()
public void setCharset(java.lang.String charset)
charset
- the character set, default is 'null' which uses the platform default.