Class HexSequenceConfiguredReplacementSource
- java.lang.Object
-
- com.adaptris.core.services.findreplace.AbstractReplacementSource
-
- com.adaptris.core.services.findreplace.HexSequenceConfiguredReplacementSource
-
- All Implemented Interfaces:
ReplacementSource
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 fromFindAndReplaceService.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 Summary
Constructors Constructor Description HexSequenceConfiguredReplacementSource()
HexSequenceConfiguredReplacementSource(java.lang.String charset)
HexSequenceConfiguredReplacementSource(java.lang.String value, java.lang.String charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCharset()
java.lang.String
obtainValue(AdaptrisMessage msg)
Obtains a replacement value forFindAndReplaceService
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.-
Methods inherited from class com.adaptris.core.services.findreplace.AbstractReplacementSource
getValue, setValue
-
-
-
-
Constructor Detail
-
HexSequenceConfiguredReplacementSource
public HexSequenceConfiguredReplacementSource()
-
HexSequenceConfiguredReplacementSource
public HexSequenceConfiguredReplacementSource(java.lang.String charset)
-
HexSequenceConfiguredReplacementSource
public HexSequenceConfiguredReplacementSource(java.lang.String value, java.lang.String charset)
-
-
Method Detail
-
obtainValue
public java.lang.String obtainValue(AdaptrisMessage msg) throws ServiceException
Description copied from interface:ReplacementSource
Obtains a replacement value for
FindAndReplaceService
based on the passed configured value.- Parameters:
msg
- theAdaptrisMessage
being processed- Returns:
- the String to be used as the replacement.
- Throws:
ServiceException
-
getCharset
public java.lang.String getCharset()
-
setCharset
public void setCharset(java.lang.String charset)
Set the character set to be used when converting the hexadecimal byte sequence into a string.- Parameters:
charset
- the character set, default is 'null' which uses the platform default.
-
-