|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.xml.XmlUtil
public class XmlUtil
Used for pretty printing XML content.
Constructor Summary | |
---|---|
XmlUtil()
|
Method Summary | |
---|---|
static SAXParser |
newSAXParser(String schemaLanguage,
boolean namespaceAware,
boolean validating,
File schema)
Factory method to create a SAXParser configured to validate according to a particular schema language and a File containing the schema to validate against. |
static SAXParser |
newSAXParser(String schemaLanguage,
boolean namespaceAware,
boolean validating,
Source... schemas)
Factory method to create a SAXParser configured to validate according to a particular schema language and optionally providing the schema sources to validate with. |
static SAXParser |
newSAXParser(String schemaLanguage,
boolean namespaceAware,
boolean validating,
URL schema)
Factory method to create a SAXParser configured to validate according to a particular schema language and an URL pointing to the schema to validate against. |
static SAXParser |
newSAXParser(String schemaLanguage,
File schema)
Factory method to create a SAXParser configured to validate according to a particular schema language and a File containing the schema to validate against. |
static SAXParser |
newSAXParser(String schemaLanguage,
Source... schemas)
Factory method to create a SAXParser configured to validate according to a particular schema language and optionally providing the schema sources to validate with. |
static SAXParser |
newSAXParser(String schemaLanguage,
URL schema)
Factory method to create a SAXParser configured to validate according to a particular schema language and an URL pointing to the schema to validate against. |
static String |
serialize(Element element)
Return a pretty String version of the Element. |
static void |
serialize(Element element,
OutputStream os)
Write a pretty version of the Element to the OutputStream. |
static void |
serialize(Element element,
Writer w)
Write a pretty version of the Element to the Writer. |
static String |
serialize(GPathResult node)
Return a pretty version of the GPathResult. |
static void |
serialize(GPathResult node,
OutputStream os)
Write a pretty version of the GPathResult to the OutputStream. |
static void |
serialize(GPathResult node,
Writer w)
Write a pretty version of the GPathResult to the Writer. |
static String |
serialize(Node node)
Return a pretty String version of the Node. |
static void |
serialize(Node node,
OutputStream os)
Write a pretty version of the Node to the OutputStream. |
static void |
serialize(Node node,
Writer w)
Write a pretty version of the Node to the Writer. |
static String |
serialize(String xmlString)
Return a pretty version of the XML content contained in the given String. |
static void |
serialize(String xmlString,
OutputStream os)
Write a pretty version of the given XML string to the OutputStream. |
static void |
serialize(String xmlString,
Writer w)
Write a pretty version of the given XML string to the Writer. |
static String |
serialize(Writable writable)
Return a pretty String version of the XML content produced by the Writable. |
static void |
serialize(Writable writable,
OutputStream os)
Write a pretty version of the XML content produced by the Writable to the OutputStream. |
static void |
serialize(Writable writable,
Writer w)
Write a pretty version of the XML content produced by the Writable to the Writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlUtil()
Method Detail |
---|
public static String serialize(Element element)
element
- the Element to serialize
public static void serialize(Element element, OutputStream os)
element
- the Element to serializeos
- the OutputStream to write topublic static void serialize(Element element, Writer w)
element
- the Element to serializew
- the Writer to write topublic static String serialize(Node node)
node
- the Node to serialize
public static void serialize(Node node, OutputStream os)
node
- the Node to serializeos
- the OutputStream to write topublic static void serialize(Node node, Writer w)
node
- the Node to serializew
- the Writer to write topublic static String serialize(GPathResult node)
node
- a GPathResult to serialize to a String
public static void serialize(GPathResult node, OutputStream os)
node
- a GPathResult to serializeos
- the OutputStream to write topublic static void serialize(GPathResult node, Writer w)
node
- a GPathResult to serializew
- the Writer to write topublic static String serialize(Writable writable)
writable
- the Writable to serialize
public static void serialize(Writable writable, OutputStream os)
writable
- the Writable to serializeos
- the OutputStream to write topublic static void serialize(Writable writable, Writer w)
writable
- the Writable to serializew
- the Writer to write topublic static String serialize(String xmlString)
xmlString
- the String to serialize
public static void serialize(String xmlString, OutputStream os)
xmlString
- the String to serializeos
- the OutputStream to write topublic static void serialize(String xmlString, Writer w)
xmlString
- the String to serializew
- the Writer to write topublic static SAXParser newSAXParser(String schemaLanguage, Source... schemas) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)schemas
- the schemas to validate against
SAXException
ParserConfigurationException
newSAXParser(String, boolean, boolean, Source...)
public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, Source... schemas) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)namespaceAware
- will the parser be namespace awarevalidating
- will the parser also validate against DTDsschemas
- the schemas to validate against
SAXException
ParserConfigurationException
public static SAXParser newSAXParser(String schemaLanguage, File schema) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)schema
- a file containing the schema to validate against
SAXException
ParserConfigurationException
newSAXParser(String, boolean, boolean, File)
public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, File schema) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)namespaceAware
- will the parser be namespace awarevalidating
- will the parser also validate against DTDsschema
- a file containing the schema to validate against
SAXException
ParserConfigurationException
public static SAXParser newSAXParser(String schemaLanguage, URL schema) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)schema
- a URL pointing to the schema to validate against
SAXException
ParserConfigurationException
newSAXParser(String, boolean, boolean, URL)
public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, URL schema) throws SAXException, ParserConfigurationException
schemaLanguage
- the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)namespaceAware
- will the parser be namespace awarevalidating
- will the parser also validate against DTDsschema
- a URL pointing to the schema to validate against
SAXException
ParserConfigurationException
|
Copyright © 2003-2012 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |