|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 String |
SLA_NAME_SPACE_URI
|
Constructor Summary | |
---|---|
XmlUtils()
|
Method Summary | |
---|---|
static Schema |
createSchema(InputStream is)
Create schema object for the given xsd |
static String |
escapeCharsForXML(String aText)
Escape characters for text appearing as XML data, between tags. |
static String |
getRootAttribute(String filePath,
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(InputStream is)
Parse a inputstream assuming it is a valid XML document and return an JDOM Element for it. |
static org.jdom.Element |
parseXml(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(String xmlStr)
Return a pretty print string for a XML string. |
static String |
removeComments(String xmlStr)
Remove comments from any Xml String. |
static void |
validateData(String xmlData,
SchemaService.SchemaName xsdFile)
|
static void |
validateXml(Schema schema,
String xml)
Schema validation for a given xml. |
static String |
writePropToString(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 String SLA_NAME_SPACE_URI
Constructor Detail |
---|
public XmlUtils()
Method Detail |
---|
public static String removeComments(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(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(InputStream is) throws org.jdom.JDOMException, IOException
is
- inputstream to parse.
org.jdom.JDOMException
- thrown if an error happend while XML parsing.
IOException
- thrown if an IO error occurred.public static String getRootAttribute(String filePath, 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(String xmlStr)
xmlStr
- XML string.
public static XmlUtils.PrettyPrint prettyPrint(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration object.
public static void validateXml(Schema schema, String xml) throws SAXException, IOException
schema
- for validationxml
- to be validated
SAXException
IOException
public static Schema createSchema(InputStream is)
is
- inputstream to schema.
public static void validateData(String xmlData, SchemaService.SchemaName xsdFile) throws SAXException, IOException
SAXException
IOException
public static String writePropToString(Properties props) throws IOException
props
-
IOException
public static String escapeCharsForXML(String aText)
<c:out>
escapes the exact same set of characters as this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |