public abstract class AbstractXmlTransformer extends AbstractMessageTransformer implements Initialisable
AbstractXmlTransformer
offers some XSLT transform on a DOM (or
other XML-ish) object.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractXmlTransformer.ResultHolder
Result callback interface used when processing XML through JAXP
|
encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes
PHASE_NAME
PHASE_NAME
PROPERTY_NAME
Constructor and Description |
---|
AbstractXmlTransformer() |
Modifier and Type | Method and Description |
---|---|
protected String |
convertToBytes(Object obj,
String outputEncoding)
Converts an XML in-memory representation to a String using a specific encoding.
|
protected String |
convertToText(Object obj)
Deprecated.
Replaced by convertToText(Object obj, String ouputEncoding)
|
protected String |
convertToText(Object obj,
String outputEncoding)
Converts an XML in-memory representation to a String using a specific encoding.
|
protected void |
doInitialise() |
boolean |
getAcceptExternalEntities() |
String |
getOutputEncoding() |
protected static AbstractXmlTransformer.ResultHolder |
getResultHolder(Class<?> desiredClass) |
XMLInputFactory |
getXMLInputFactory() |
XMLOutputFactory |
getXMLOutputFactory() |
void |
initialise()
Template method where deriving classes can do any initialisation after the
properties have been set on this transformer
|
boolean |
isUseStaxSource() |
void |
setAcceptExternalEntities(boolean acceptExternalEntities) |
void |
setOutputEncoding(String outputEncoding) |
void |
setUseStaxSource(boolean useStaxSource) |
void |
setXMLInputFactory(XMLInputFactory xmlInputFactory) |
void |
setXMLOutputFactory(XMLOutputFactory xmlOutputFactory) |
protected void |
writeToStream(Object obj,
String outputEncoding,
OutputStream output) |
checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform, transformMessage
dispose, generateTransformerName, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType
getAnnotation, getAnnotations, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform
process
dispose
setName
getName
setMuleContext
setEndpoint
public final void initialise() throws InitialisationException
AbstractTransformer
initialise
in interface Initialisable
initialise
in class AbstractTransformer
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered fromprotected void doInitialise() throws InitialisationException
InitialisationException
protected static AbstractXmlTransformer.ResultHolder getResultHolder(Class<?> desiredClass)
desiredClass
- Java class representing the desired format@Deprecated protected String convertToText(Object obj) throws Exception
obj
- Object to convert (could be byte[], String, DOM, DOM4J)TransformerFactoryConfigurationError
- On errorTransformerException
- On errorTransformerException
Exception
protected String convertToText(Object obj, String outputEncoding) throws Exception
obj
- Object to convert (could be byte[], String, DOM, or DOM4J Document).
If the object is a byte[], the character
encoding used MUST match the declared encoding standard, or a parse error will occur.outputEncoding
- Name of the XML encoding to use, e.g. US-ASCII, or null for UTF-8TransformerFactoryConfigurationError
- On errorTransformerException
- On errorTransformerException
Exception
protected String convertToBytes(Object obj, String outputEncoding) throws Exception
obj
- Object to convert (could be byte[], String, DOM, or DOM4J Document).
If the object is a byte[], the character
encoding used MUST match the declared encoding standard, or a parse error will occur.outputEncoding
- Name of the XML encoding to use, e.g. US-ASCII, or null for UTF-8TransformerFactoryConfigurationError
- On errorTransformerException
- On errorTransformerException
Exception
protected void writeToStream(Object obj, String outputEncoding, OutputStream output) throws Exception
Exception
public String getOutputEncoding()
public void setOutputEncoding(String outputEncoding)
outputEncoding
- the outputEncoding to setpublic boolean isUseStaxSource()
public void setUseStaxSource(boolean useStaxSource)
public XMLInputFactory getXMLInputFactory()
public void setXMLInputFactory(XMLInputFactory xmlInputFactory)
public XMLOutputFactory getXMLOutputFactory()
public void setXMLOutputFactory(XMLOutputFactory xmlOutputFactory)
public void setAcceptExternalEntities(boolean acceptExternalEntities)
public boolean getAcceptExternalEntities()
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.