|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler groovy.util.XmlSlurper
public class XmlSlurper
Constructor Summary | |
---|---|
XmlSlurper()
|
|
XmlSlurper(boolean validating,
boolean namespaceAware)
|
|
XmlSlurper(SAXParser parser)
|
|
XmlSlurper(XMLReader reader)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(String namespaceURI,
String localName,
String qName)
|
GPathResult |
getDocument()
|
DTDHandler |
getDTDHandler()
|
EntityResolver |
getEntityResolver()
|
ErrorHandler |
getErrorHandler()
|
boolean |
getFeature(String uri)
|
Object |
getProperty(String uri)
|
GPathResult |
parse(File file)
Parses the content of the given file as XML turning it into a GPathResult object |
GPathResult |
parse(InputSource input)
Parse the content of the specified input source into a GPathResult object |
GPathResult |
parse(InputStream input)
Parse the content of the specified input stream into an GPathResult Object. |
GPathResult |
parse(Reader in)
Parse the content of the specified reader into a GPathResult Object. |
GPathResult |
parse(String uri)
Parse the content of the specified URI into a GPathResult Object |
GPathResult |
parseText(String text)
A helper method to parse the given text as XML |
void |
setDTDHandler(DTDHandler dtdHandler)
|
void |
setEntityBaseUrl(URL base)
Resolves entities against using the suppied URL as the base for relative URLs |
void |
setEntityResolver(EntityResolver entityResolver)
|
void |
setErrorHandler(ErrorHandler errorHandler)
|
void |
setFeature(String uri,
boolean value)
|
void |
setKeepWhitespace(boolean keepWhitespace)
|
void |
setProperty(String uri,
Object value)
|
void |
startDocument()
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
|
void |
startPrefixMapping(String tag,
String uri)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlSlurper() throws ParserConfigurationException, SAXException
ParserConfigurationException
SAXException
public XmlSlurper(boolean validating, boolean namespaceAware) throws ParserConfigurationException, SAXException
ParserConfigurationException
SAXException
public XmlSlurper(XMLReader reader)
public XmlSlurper(SAXParser parser) throws SAXException
SAXException
Method Detail |
---|
public void setKeepWhitespace(boolean keepWhitespace)
keepWhitespace
- If true then whitespace before elements is kept.
The default is to discard the whitespace.public GPathResult getDocument()
public GPathResult parse(InputSource input) throws IOException, SAXException
input
-
IOException
SAXException
public GPathResult parse(File file) throws IOException, SAXException
file
-
IOException
SAXException
public GPathResult parse(InputStream input) throws IOException, SAXException
input
-
IOException
SAXException
public GPathResult parse(Reader in) throws IOException, SAXException
in
-
IOException
SAXException
public GPathResult parse(String uri) throws IOException, SAXException
uri
-
IOException
SAXException
public GPathResult parseText(String text) throws IOException, SAXException
text
-
IOException
SAXException
public DTDHandler getDTDHandler()
public EntityResolver getEntityResolver()
public ErrorHandler getErrorHandler()
public boolean getFeature(String uri) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
public Object getProperty(String uri) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
public void setDTDHandler(DTDHandler dtdHandler)
public void setEntityResolver(EntityResolver entityResolver)
public void setEntityBaseUrl(URL base)
base
- The URL used to resolve relative URLspublic void setErrorHandler(ErrorHandler errorHandler)
public void setFeature(String uri, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
public void setProperty(String uri, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
public void startPrefixMapping(String tag, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
SAXException
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
|
Copyright © 2003-2010 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |