org.mule.module.xml.transformer
Class AbstractXmlTransformer
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.AbstractMessageTransformer
org.mule.module.xml.transformer.AbstractXmlTransformer
- All Implemented Interfaces:
- MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware
- Direct Known Subclasses:
- DomDocumentToXml, XmlToDomDocument, XmlToOutputHandler, XmlToXMLStreamReader, XQueryTransformer, XsltTransformer
public abstract class AbstractXmlTransformer
- extends AbstractMessageTransformer
AbstractXmlTransformer
offers some XSLT transform on a DOM (or
other XML-ish) object.
Methods inherited from class org.mule.transformer.AbstractTransformer |
checkReturnClass, dispose, generateTransformerName, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, onNotification, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mule.api.transformer.Transformer |
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform |
AbstractXmlTransformer
public AbstractXmlTransformer()
getResultHolder
protected static AbstractXmlTransformer.ResultHolder getResultHolder(java.lang.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
@Deprecated
protected java.lang.String convertToText(java.lang.Object obj)
throws java.lang.Exception
- 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:
javax.xml.transform.TransformerFactoryConfigurationError
- On error
javax.xml.transform.TransformerException
- On error
TransformerException
java.lang.Exception
convertToText
protected java.lang.String convertToText(java.lang.Object obj,
java.lang.String outputEncoding)
throws java.lang.Exception
- 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:
javax.xml.transform.TransformerFactoryConfigurationError
- On error
javax.xml.transform.TransformerException
- On error
TransformerException
java.lang.Exception
convertToBytes
protected java.lang.String convertToBytes(java.lang.Object obj,
java.lang.String outputEncoding)
throws java.lang.Exception
- 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:
javax.xml.transform.TransformerFactoryConfigurationError
- On error
javax.xml.transform.TransformerException
- On error
TransformerException
java.lang.Exception
writeToStream
protected void writeToStream(java.lang.Object obj,
java.lang.String outputEncoding,
java.io.OutputStream output)
throws java.lang.Exception
- Throws:
java.lang.Exception
getOutputEncoding
public java.lang.String getOutputEncoding()
- Returns:
- the outputEncoding
setOutputEncoding
public void setOutputEncoding(java.lang.String outputEncoding)
- Parameters:
outputEncoding
- the outputEncoding to set
isUseStaxSource
public boolean isUseStaxSource()
setUseStaxSource
public void setUseStaxSource(boolean useStaxSource)
getXMLInputFactory
public javax.xml.stream.XMLInputFactory getXMLInputFactory()
setXMLInputFactory
public void setXMLInputFactory(javax.xml.stream.XMLInputFactory xmlInputFactory)
getXMLOutputFactory
public javax.xml.stream.XMLOutputFactory getXMLOutputFactory()
setXMLOutputFactory
public void setXMLOutputFactory(javax.xml.stream.XMLOutputFactory xmlOutputFactory)
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.