|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.util.XMLUtils
org.mule.module.xml.util.XMLUtils
public class XMLUtils
General utility methods for working with XML.
Field Summary | |
---|---|
static java.lang.String |
APACHE_XML_FEATURES_VALIDATION_SCHEMA
|
static java.lang.String |
APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING
|
static java.lang.String |
JAXP_PROPERTIES_SCHEMA_LANGUAGE
|
static java.lang.String |
JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE
|
static java.lang.String |
JAXP_PROPERTIES_SCHEMA_SOURCE
|
static java.lang.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 javax.xml.transform.Transformer |
getTransformer()
|
static java.util.List<org.w3c.dom.Node> |
select(java.lang.String xpath,
org.w3c.dom.Node node)
Select a set of Node objects using the Xpath expression |
static org.w3c.dom.Node |
selectOne(java.lang.String xpath,
org.w3c.dom.Node node)
Select a single XML node using an Xpath |
static java.lang.String |
selectValue(java.lang.String xpath,
org.w3c.dom.Node node)
Select a single XML String value using an Xpath |
static org.dom4j.Document |
toDocument(java.lang.Object obj,
MuleContext muleContext)
|
static org.dom4j.Document |
toDocument(java.lang.Object obj,
java.lang.String externalSchemaLocation,
MuleContext muleContext)
Converts an object of unknown type to an org.dom4j.Document if possible. |
static javax.xml.transform.Source |
toStreamSource(javax.xml.stream.XMLInputFactory xmlInputFactory,
boolean useStaxSource,
java.io.InputStream stream)
|
static org.w3c.dom.Document |
toW3cDocument(java.lang.Object payload)
Converts a payload to a Document representation. |
static java.lang.String |
toXml(org.w3c.dom.Document dom)
Converts a DOM to an XML string. |
static javax.xml.transform.Source |
toXmlSource(javax.xml.stream.XMLInputFactory xmlInputFactory,
boolean useStaxSource,
java.lang.Object src)
Convert our object to a Source type efficiently. |
static javax.xml.stream.XMLStreamReader |
toXMLStreamReader(javax.xml.stream.XMLInputFactory factory,
java.lang.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 |
---|
public static final java.lang.String TRANSFORMER_FACTORY_JDK5
public static final java.lang.String APACHE_XML_FEATURES_VALIDATION_SCHEMA
public static final java.lang.String APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING
public static final java.lang.String JAXP_PROPERTIES_SCHEMA_SOURCE
public static final java.lang.String JAXP_PROPERTIES_SCHEMA_LANGUAGE
public static final java.lang.String JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE
Constructor Detail |
---|
public XMLUtils()
Method Detail |
---|
public static java.lang.String toXml(org.w3c.dom.Document dom)
dom
- the dome object to convert
public static javax.xml.transform.Transformer getTransformer() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if no TransformerFactory can be located in the
runtime environment.public static org.dom4j.Document toDocument(java.lang.Object obj, MuleContext muleContext) throws java.lang.Exception
java.lang.Exception
public static org.dom4j.Document toDocument(java.lang.Object obj, java.lang.String externalSchemaLocation, MuleContext muleContext) throws java.lang.Exception
org.dom4j.DocumentException
- if an error occurs while parsing
java.lang.Exception
public static org.w3c.dom.Document toW3cDocument(java.lang.Object payload) throws java.lang.Exception
Document
representation.
Reproduces the behavior from toDocument(Object, MuleContext)
which works converting to Document
.
payload
- the payload to convert.
java.lang.Exception
public static javax.xml.stream.XMLStreamReader toXMLStreamReader(javax.xml.stream.XMLInputFactory factory, java.lang.Object obj) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static javax.xml.transform.Source toXmlSource(javax.xml.stream.XMLInputFactory xmlInputFactory, boolean useStaxSource, java.lang.Object src) throws java.lang.Exception
java.lang.Exception
public static javax.xml.transform.Source toStreamSource(javax.xml.stream.XMLInputFactory xmlInputFactory, boolean useStaxSource, java.io.InputStream stream) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static void copy(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException
reader
- writer
-
javax.xml.stream.XMLStreamException
public static void copy(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.XMLStreamWriter writer, boolean fragment) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static org.w3c.dom.Node selectOne(java.lang.String xpath, org.w3c.dom.Node node) throws javax.xml.xpath.XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to exaluate on
javax.xml.xpath.XPathExpressionException
- if the XPath expression is malformed and cannot be parsedpublic static java.lang.String selectValue(java.lang.String xpath, org.w3c.dom.Node node) throws javax.xml.xpath.XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to evaluate on
javax.xml.xpath.XPathExpressionException
- if the XPath expression is malformed and cannot be parsedpublic static java.util.List<org.w3c.dom.Node> select(java.lang.String xpath, org.w3c.dom.Node node) throws javax.xml.xpath.XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to evaluate on
javax.xml.xpath.XPathExpressionException
- if the XPath expression is malformed and cannot be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |