Package com.adaptris.core.services
Class UseXmlCharsetAsEncodingService
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.services.UseXmlCharsetAsEncodingService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Change the character encoding of a message based on the XML charset",
tag="service,xml,encoding")
public class UseXmlCharsetAsEncodingService
extends ServiceImp
Changes the character encoding associated with a message.
This service does nothing with the data, but simply changes the character encoding associated with the message using
AdaptrisMessage.setCharEncoding(String)
after parsing the XML via XMLStreamReader
. If there is
no encoding specified via XMLStreamReader.getCharacterEncodingScheme()
then no change occurs.
In the adapter configuration file this class is aliased as use-xml-charset-as-encoding which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
doService
(AdaptrisMessage msg) Apply the service to the message.protected void
void
prepare()
Prepare for initialisation.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
-
Constructor Details
-
UseXmlCharsetAsEncodingService
public UseXmlCharsetAsEncodingService()
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-