Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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, BaseTransformer, MessageTransformer, Transformer

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.

Nested Class Summary
`protected static interface` | `AbstractXmlTransformer.ResultHolder` Result callback interface used when processing XML through JAXP

Field Summary

Fields inherited from class org.mule.transformer.AbstractTransformer
`encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`AbstractXmlTransformer()`

Method Summary
`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)`

Methods inherited from class org.mule.transformer.AbstractMessageTransformer
`checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform, transformMessage`

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, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform`

Methods inherited from interface org.mule.api.transformer.BaseTransformer
`getEndpoint, setEndpoint`

Methods inherited from interface org.mule.api.processor.MessageProcessor
`process`

Methods inherited from interface org.mule.api.lifecycle.Initialisable
`initialise`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Methods inherited from interface org.mule.api.NamedObject
`getName, setName`

Methods inherited from interface org.mule.api.context.MuleContextAware
`setMuleContext`

Constructor Detail

### AbstractXmlTransformer

    public AbstractXmlTransformer()

Method Detail

### 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 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:
    `TransformerFactoryConfigurationError` - On error
    `TransformerException` - On error
    `TransformerException`
    `Exception`

### convertToText

    protected String convertToText(Object obj,
                                   String outputEncoding)
                            throws 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:
    `TransformerFactoryConfigurationError` - On error
    `TransformerException` - On error
    `TransformerException`
    `Exception`

### convertToBytes

    protected String convertToBytes(Object obj,
                                    String outputEncoding)
                             throws 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:
    `TransformerFactoryConfigurationError` - On error
    `TransformerException` - On error
    `TransformerException`
    `Exception`

### writeToStream

    protected void writeToStream(Object obj,
                                 String outputEncoding,
                                 OutputStream output)
                          throws Exception

  Throws:
    `Exception`

### getOutputEncoding

    public String getOutputEncoding()

  Returns:
    the outputEncoding

### setOutputEncoding

    public void setOutputEncoding(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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.