Class HexToStringService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.ReformatMetadata
-
- com.adaptris.core.services.metadata.HexToStringService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,MetadataReformatter
,StateManagedComponent
- Direct Known Subclasses:
StringToHexService
@ComponentProfile(summary="Turn a hex encoded string into a java string using the specified character encoding", tag="service,metadata") public class HexToStringService extends ReformatMetadata
This class will decode hex encoded metadata value(s) using the specified character encoding- See Also:
StringToHexService
In the adapter configuration file this class is aliased as hex-to-string-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
MetadataServiceImpl.LogWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
UTF_8
-
Fields inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
DEBUG, ERROR, INFO, TRACE, WARN
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description HexToStringService()
HexToStringService(java.lang.String regex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getCharacterEncoding()
java.lang.String
getCharset()
java.lang.String
reformat(java.lang.String s, java.lang.String msgCharset)
Reformat a metadata valuevoid
setCharset(java.lang.String encoding)
The character encoding to be applied when decoding the hex string.-
Methods inherited from class com.adaptris.core.services.metadata.ReformatMetadata
doService, getMetadataKeyRegexp, setMetadataKeyRegexp
-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, initService, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.services.metadata.MetadataReformatter
reformat
-
-
-
-
Field Detail
-
UTF_8
protected static final java.lang.String UTF_8
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCharset
public java.lang.String getCharset()
-
setCharset
public void setCharset(java.lang.String encoding)
The character encoding to be applied when decoding the hex string. If no encoding is specified, UTF8 will be used.- Parameters:
encoding
-
-
getCharacterEncoding
protected java.lang.String getCharacterEncoding()
-
reformat
public java.lang.String reformat(java.lang.String s, java.lang.String msgCharset) throws java.lang.Exception
Description copied from interface:MetadataReformatter
Reformat a metadata value- Parameters:
s
- the string to reformatmsgCharset
- the charset of the message- Returns:
- the replacment string.
- Throws:
java.lang.Exception
-
-