org.mule.transformers.xml
Class AbstractXmlTransformer
java.lang.Object
org.mule.transformers.AbstractTransformer
org.mule.transformers.xml.AbstractXmlTransformer
- All Implemented Interfaces:
- Cloneable, Initialisable, UMOBaseTransformer, UMOTransformer
- Direct Known Subclasses:
- DomDocumentToXml, XmlToDomDocument, XsltTransformer
- public abstract class AbstractXmlTransformer
- extends AbstractTransformer
AbstractXmlTransformer
offers some XSLT transform on a DOM (or
other XML-ish) object.
Methods inherited from class org.mule.transformers.AbstractTransformer |
checkReturnClass, clone, doTransform, generateTransformerName, getEndpoint, getFinalReturnClass, getName, getNextTransformer, getReturnClass, initialise, isAcceptNull, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, nextTransform, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setNextTransformer, setReturnClass, toString, transform, unregisterSourceType |
AbstractXmlTransformer
public AbstractXmlTransformer()
getXmlSource
public Source getXmlSource(Object src)
getResultHolder
protected static AbstractXmlTransformer.ResultHolder getResultHolder(Class desiredClass)
- Parameters:
desiredClass
- Java class representing the desired format
- Returns:
- Callback interface representing the desiredClass - or null if the
return class isn't supported (or is null).
convertToText
protected String convertToText(Object obj)
throws TransformerFactoryConfigurationError,
TransformerException
- Deprecated. Replaced by convertToText(Object obj, String ouputEncoding)
- Converts an XML in-memory representation to a String
- Parameters:
obj
- Object to convert (could be byte[], String, DOM, DOM4J)
- Returns:
- String including XML header using default (UTF-8) encoding
- Throws:
TransformerFactoryConfigurationError
- On error
TransformerException
- On error
convertToText
protected String convertToText(Object obj,
String outputEncoding)
throws TransformerFactoryConfigurationError,
TransformerException
- Converts an XML in-memory representation to a String using a specific encoding.
If using an encoding which cannot represent specific characters, these are
written as entities, even if they can be represented as a Java String.
- Parameters:
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-8
- Returns:
- String including XML header using the specified encoding
- Throws:
TransformerFactoryConfigurationError
- On error
TransformerException
- On error
convertToBytes
protected String convertToBytes(Object obj,
String outputEncoding)
throws TransformerFactoryConfigurationError,
TransformerException
- Converts an XML in-memory representation to a String using a specific encoding.
- Parameters:
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-8
- Returns:
- String including XML header using the specified encoding
- Throws:
TransformerFactoryConfigurationError
- On error
TransformerException
- On error
getOutputEncoding
public String getOutputEncoding()
- Returns:
- the outputEncoding
setOutputEncoding
public void setOutputEncoding(String outputEncoding)
- Parameters:
outputEncoding
- the outputEncoding to set
Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.