| Type | Name and description |
|---|---|
static ConfigSlurper |
configSlurper |
static JsonSlurper |
jsonSlurper |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static ConfigObject |
toConfig(String self) |
|
static Object |
toJson(String self) |
|
static GPathResult |
toXml(String self)Parse a String as XML via XmlSlurper |
|
static GPathResult |
toXml(String self, boolean validating, boolean namespaceAware) |
|
static GPathResult |
toXml(String self, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration) |
|
static GPathResult |
toXml(String self, javax.xml.parsers.SAXParser parser)Parse a String as XML via XmlSlurper with a specified SAXParser. |
|
static GPathResult |
toXml(String self, org.xml.sax.XMLReader reader) |
Parse a String as XML via XmlSlurper
assert ''.toXml().name.text() == 'Matt' Matt
self - The String to parseParse a String as XML via XmlSlurper with a specified SAXParser.
// Given some unhinged HTML def text="""|""".stripMargin() // Pick your HTML cleaner of choice, and pass it to toXml def parsed = text.toXml(new org.cyberneko.html.parsers.SAXParser()) assert parsed.BODY.DIV.DIV.SPAN.text().trim() == 'Hi'Test
|| Hi ||
self - The String to parseparser - The SAXParser to use