Package com.adaptris.stax.lms
Class StaxStartDocument
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.stax.lms.StaxXmlOutput
com.adaptris.stax.lms.StaxStartDocument
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="Prepare for writing large XML output via STaX",
tag="service,transform,xml",
since="3.6.6")
public class StaxStartDocument
extends StaxXmlOutput
Prepare ourselves for writing some large XML output via STaX.
For this service to work, the underlying AdaptrisMessageFactory associated with the AdaptrisMessage instance must
be a FileBackedMessageFactory and subsequent processing should include multiple instances of StaxWriteElement to
write XML elements and finally StaxEndDocument to commit the output; so effectively your processing chain should be
<stax-xml-start-document/>
... 0 or more instances of <stax-xml-write-element/>
<stax-xml-end-document/>
- See Also:
In the adapter configuration file this class is aliased as stax-xml-start-document which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
FieldsFields inherited from class com.adaptris.core.ServiceImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoService(AdaptrisMessage msg) voidvoidsetOutputMessageEncoding(String encoding) Set the encoding for the resulting XML document.voidvoidSet the root element for the XML document.Methods inherited from class com.adaptris.stax.lms.StaxXmlOutput
closeQuietly, closeService, initService, messageFactory, prepare, unwrapMethods 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
-
Field Details
-
DEFAULT_ROOT_ELEMENT
- See Also:
-
-
Constructor Details
-
StaxStartDocument
public StaxStartDocument() -
StaxStartDocument
-
-
Method Details
-
doService
- Throws:
ServiceException
-
getOutputMessageEncoding
-
setOutputMessageEncoding
Set the encoding for the resulting XML document.If not specified the following rules will be applied:
- If the
AdaptrisMessage.getCharEncoding()is non-null then that will be used. - UTF-8
As a result; the character encoding on the message is always set using
AdaptrisMessage.setCharEncoding(String).- Parameters:
encoding- the character
- If the
-
getRootElement
-
setRootElement
Set the root element for the XML document.- Parameters:
s- the root element, default is "root" if not specified.
-
getPrefix
- Returns:
- the prefix
-
setPrefix
- Parameters:
prefix- the prefix to set
-
getNamespaceUri
- Returns:
- the namespaceUri
-
setNamespaceUri
- Parameters:
s- the namespaceUri to set
-