|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.util.XmlUtils
public class XmlUtils
XML utility methods.
| Nested Class Summary | |
|---|---|
static class |
XmlUtils.PrettyPrint
Pretty print string representation of an XML document that generates the pretty print on lazy mode when the XmlUtils.PrettyPrint.toString() method is invoked. |
| Field Summary | |
|---|---|
static java.lang.String |
SLA_NAME_SPACE_URI
|
| Constructor Summary | |
|---|---|
XmlUtils()
|
|
| Method Summary | |
|---|---|
static javax.xml.validation.Schema |
createSchema(java.io.InputStream is)
Create schema object for the given xsd |
static java.lang.String |
getRootAttribute(java.lang.String filePath,
java.lang.String attributeName)
//TODO move this to action registry method Return the value of an attribute from the root element of an XML document. |
static org.jdom.Element |
parseXml(java.io.InputStream is)
Parse a inputstream assuming it is a valid XML document and return an JDOM Element for it. |
static org.jdom.Element |
parseXml(java.lang.String xmlStr)
Parse a string assuming it is a valid XML document and return an JDOM Element for it. |
static XmlUtils.PrettyPrint |
prettyPrint(org.apache.hadoop.conf.Configuration conf)
Return a pretty print string for a Configuration object. |
static XmlUtils.PrettyPrint |
prettyPrint(org.jdom.Element element)
Return a pretty print string for a JDOM Element. |
static XmlUtils.PrettyPrint |
prettyPrint(java.lang.String xmlStr)
Return a pretty print string for a XML string. |
static java.lang.String |
removeComments(java.lang.String xmlStr)
Remove comments from any Xml String. |
static void |
validateData(java.lang.String xmlData,
SchemaService.SchemaName xsdFile)
|
static void |
validateXml(javax.xml.validation.Schema schema,
java.lang.String xml)
Schema validation for a given xml. |
static java.lang.String |
writePropToString(java.util.Properties props)
Convert Properties to string |
| 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 SLA_NAME_SPACE_URI
| Constructor Detail |
|---|
public XmlUtils()
| Method Detail |
|---|
public static java.lang.String removeComments(java.lang.String xmlStr)
throws org.jdom.JDOMException
xmlStr - XML string to remove comments.
org.jdom.JDOMException - thrown if an error happend while XML parsing.
public static org.jdom.Element parseXml(java.lang.String xmlStr)
throws org.jdom.JDOMException
xmlStr - XML string to parse.
org.jdom.JDOMException - thrown if an error happend while XML parsing.
public static org.jdom.Element parseXml(java.io.InputStream is)
throws org.jdom.JDOMException,
java.io.IOException
is - inputstream to parse.
org.jdom.JDOMException - thrown if an error happend while XML parsing.
java.io.IOException - thrown if an IO error occurred.
public static java.lang.String getRootAttribute(java.lang.String filePath,
java.lang.String attributeName)
filePath - path of the XML document.attributeName - attribute to retrieve value for.
public static XmlUtils.PrettyPrint prettyPrint(org.jdom.Element element)
element - JDOM element.
public static XmlUtils.PrettyPrint prettyPrint(java.lang.String xmlStr)
xmlStr - XML string.
public static XmlUtils.PrettyPrint prettyPrint(org.apache.hadoop.conf.Configuration conf)
conf - Configuration object.
public static void validateXml(javax.xml.validation.Schema schema,
java.lang.String xml)
throws org.xml.sax.SAXException,
java.io.IOException
schema - for validationxml - to be validated
org.xml.sax.SAXException
java.io.IOExceptionpublic static javax.xml.validation.Schema createSchema(java.io.InputStream is)
is - inputstream to schema.
public static void validateData(java.lang.String xmlData,
SchemaService.SchemaName xsdFile)
throws org.xml.sax.SAXException,
java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public static java.lang.String writePropToString(java.util.Properties props)
throws java.io.IOException
props -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||