public abstract class AbstractXmlTransformer extends AbstractTransformer
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
|
DEFAULT_TRUNCATE_LENGTH, endpoint, logger, name, returnClass, sourceTypes
PHASE_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.
|
String |
getOutputEncoding() |
protected static AbstractXmlTransformer.ResultHolder |
getResultHolder(Class desiredClass) |
javax.xml.stream.XMLInputFactory |
getXMLInputFactory() |
javax.xml.stream.XMLOutputFactory |
getXMLOutputFactory() |
boolean |
isUseStaxSource() |
void |
setOutputEncoding(String outputEncoding) |
void |
setUseStaxSource(boolean useStaxSource) |
void |
setXMLInputFactory(javax.xml.stream.XMLInputFactory xmlInputFactory) |
void |
setXMLOutputFactory(javax.xml.stream.XMLOutputFactory xmlOutputFactory) |
protected void |
writeToStream(Object obj,
String outputEncoding,
OutputStream output) |
checkReturnClass, doTransform, generateTransformerName, getEndpoint, getName, getReturnClass, getSourceTypes, initialise, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setReturnClass, toString, transform, unregisterSourceType
protected static AbstractXmlTransformer.ResultHolder getResultHolder(Class desiredClass)
desiredClass
- Java class representing the desired formatprotected String convertToText(Object obj) throws TransformerFactoryConfigurationError, TransformerException, TransformerException
obj
- Object to convert (could be byte[], String, DOM, DOM4J)TransformerFactoryConfigurationError
- On errorTransformerException
- On errorTransformerException
protected String convertToText(Object obj, String outputEncoding) throws TransformerFactoryConfigurationError, TransformerException, TransformerException
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
protected String convertToBytes(Object obj, String outputEncoding) throws TransformerFactoryConfigurationError, TransformerException, TransformerException
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
protected void writeToStream(Object obj, String outputEncoding, OutputStream output) throws TransformerFactoryConfigurationError, TransformerException, TransformerException
public String getOutputEncoding()
public void setOutputEncoding(String outputEncoding)
outputEncoding
- the outputEncoding to setpublic boolean isUseStaxSource()
public void setUseStaxSource(boolean useStaxSource)
public javax.xml.stream.XMLInputFactory getXMLInputFactory()
public void setXMLInputFactory(javax.xml.stream.XMLInputFactory xmlInputFactory)
public javax.xml.stream.XMLOutputFactory getXMLOutputFactory()
public void setXMLOutputFactory(javax.xml.stream.XMLOutputFactory xmlOutputFactory)
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.