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.util
Class XMLUtils

    java.lang.Object
      org.mule.util.XMLUtils
          org.mule.module.xml.util.XMLUtils

    public class XMLUtils

extends XMLUtils

General utility methods for working with XML.

Field Summary
`static String` | `APACHE_XML_FEATURES_VALIDATION_SCHEMA`
`static String` | `APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING`
`static String` | `JAXP_PROPERTIES_SCHEMA_LANGUAGE`
`static String` | `JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE`
`static String` | `JAXP_PROPERTIES_SCHEMA_SOURCE`
`static String` | `TRANSFORMER_FACTORY_JDK5`

Constructor Summary
`XMLUtils()`

Method Summary
`static void` | `copy(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.XMLStreamWriter writer)` Copies the reader to the writer.
`static void` | `copy(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.XMLStreamWriter writer, boolean fragment)`
`static Transformer` | `getTransformer()`
`static org.dom4j.Document` | `toDocument(Object obj, MuleContext muleContext)`
`static org.dom4j.Document` | `toDocument(Object obj, String externalSchemaLocation, MuleContext muleContext)` Converts an object of unknown type to an org.dom4j.Document if possible.
`static Source` | `toStreamSource(javax.xml.stream.XMLInputFactory xmlInputFactory, boolean useStaxSource, InputStream stream)`
`static String` | `toXml(Document dom)` Converts a DOM to an XML string.
`static Source` | `toXmlSource(javax.xml.stream.XMLInputFactory xmlInputFactory, boolean useStaxSource, Object src)` Convert our object to a Source type efficiently.
`static javax.xml.stream.XMLStreamReader` | `toXMLStreamReader(javax.xml.stream.XMLInputFactory factory, Object obj)` Returns an XMLStreamReader for an object of unknown type if possible.

Methods inherited from class org.mule.util.XMLUtils
`attributeName, elementToString, getTextChild, isLocalName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRANSFORMER_FACTORY_JDK5

    public static final String TRANSFORMER_FACTORY_JDK5

See Also:
  Constant Field Values

### APACHE_XML_FEATURES_VALIDATION_SCHEMA

    public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA

See Also:
  Constant Field Values

### APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING

    public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING

See Also:
  Constant Field Values

### JAXP_PROPERTIES_SCHEMA_SOURCE

    public static final String JAXP_PROPERTIES_SCHEMA_SOURCE

See Also:
  Constant Field Values

### JAXP_PROPERTIES_SCHEMA_LANGUAGE

    public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE

See Also:
  Constant Field Values

### JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE

    public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE

See Also:
  Constant Field Values

Constructor Detail

### XMLUtils

    public XMLUtils()

Method Detail

### toXml

    public static String toXml(Document dom)

  Converts a DOM to an XML string.

### getTransformer

    public static Transformer getTransformer()
                                      throws TransformerConfigurationException

  Returns:
    a new XSLT transformer
  Throws:
    `TransformerConfigurationException` - if no TransformerFactory can be located in the runtime environment.

### toDocument

    public static org.dom4j.Document toDocument(Object obj,
                                                MuleContext muleContext)
                                         throws Exception

  Throws:
    `Exception`

### toDocument

    public static org.dom4j.Document toDocument(Object obj,
                                                String externalSchemaLocation,
                                                MuleContext muleContext)
                                         throws Exception

  Converts an object of unknown type to an org.dom4j.Document if possible.

  Returns:
    null if object cannot be converted
  Throws:
    `org.dom4j.DocumentException` - if an error occurs while parsing
    `Exception`

### toXMLStreamReader

    public static javax.xml.stream.XMLStreamReader toXMLStreamReader(javax.xml.stream.XMLInputFactory factory,
                                                                     Object obj)
                                                              throws javax.xml.stream.XMLStreamException

  Returns an XMLStreamReader for an object of unknown type if possible.

  Returns:
    null if no XMLStreamReader can be created for the object type
  Throws:
    `javax.xml.stream.XMLStreamException`

### toXmlSource

    public static Source toXmlSource(javax.xml.stream.XMLInputFactory xmlInputFactory,
                                     boolean useStaxSource,
                                     Object src)
                              throws Exception

  Convert our object to a Source type efficiently.

  Throws:
    `Exception`

### toStreamSource

    public static Source toStreamSource(javax.xml.stream.XMLInputFactory xmlInputFactory,
                                        boolean useStaxSource,
                                        InputStream stream)
                                 throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

### copy

    public static void copy(javax.xml.stream.XMLStreamReader reader,
                            javax.xml.stream.XMLStreamWriter writer)
                     throws javax.xml.stream.XMLStreamException

  Copies the reader to the writer. The start and end document methods must be handled on the writer manually. TODO: if the namespace on the reader has been declared previously to where we are in the stream, this probably won't work.

  Parameters:
    `reader` -
    `writer` -
  Throws:
    `javax.xml.stream.XMLStreamException`

### copy

    public static void copy(javax.xml.stream.XMLStreamReader reader,
                            javax.xml.stream.XMLStreamWriter writer,
                            boolean fragment)
                     throws javax.xml.stream.XMLStreamException

  Throws:
    `javax.xml.stream.XMLStreamException`

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-2009 MuleSource, Inc.. All Rights Reserved.