|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.monoid.web.Resty
us.monoid.web.AbstractResource
us.monoid.web.TextResource
us.monoid.web.XMLResource
public class XMLResource
Resource presentation for an XML document. You can access the XML as a DOM document. I know, DOM sucks, but you are free to change this class to support your favorite XML parser. What is not so sucky is access to the XML via XPath with the convenient get(...) methods.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class us.monoid.web.Resty |
---|
Resty.Option, Resty.Proxy, Resty.Timeout |
Constructor Summary | |
---|---|
XMLResource(Resty.Option... options)
|
Method Summary | ||
---|---|---|
Document |
doc()
Return the DOM of the XML resource. |
|
NodeList |
get(String xPath)
Access the XML evaluating an XPath on it, returning the resulting NodeList. |
|
|
get(String xPath,
Class<T> returnType)
Access the XML evaluating an XPath on it, returning the resulting Object of the desired type Supported types are NodeList, String, Boolean, Double, Node. |
|
JSONResource |
json(XPathQuery path)
Execute the given path query on the XML, GET the returned URI expecting JSON as content |
|
JSONResource |
json(XPathQuery path,
Content aContent)
Execute the given path query on the XML, POST the returned URI expecting JSON |
|
TextResource |
text(XPathQuery path)
Execute the given path query on the XML, GET the returned URI expecting text/* as content |
|
TextResource |
text(XPathQuery path,
Content aContent)
Execute the given path query on the XML, POST the returned URI expecting text/* |
|
XMLResource |
xml(XPathQuery path)
Execute the given path query on the XML, GET the returned URI expecting xml/* as content |
|
XMLResource |
xml(XPathQuery path,
Content aContent)
Execute the given path query on the XML, POST the returned URI expecting XML |
Methods inherited from class us.monoid.web.TextResource |
---|
toString |
Methods inherited from class us.monoid.web.AbstractResource |
---|
getUrlConnection, http, location, status, stream |
Methods inherited from class us.monoid.web.Resty |
---|
alwaysSend, authenticate, authenticate, authenticateForRealm, bytes, bytes, bytes, bytes, content, content, content, data, data, delete, dontSend, enc, form, form, identifyAsMozilla, identifyAsResty, ignoreAllCerts, json, json, json, json, path, put, setOptions, setProxy, text, text, text, text, withHeader, xml, xml, xml, xml, xpath |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XMLResource(Resty.Option... options)
Method Detail |
---|
public Document doc() throws IOException
IOException
public JSONResource json(XPathQuery path) throws Exception
path
- path to the URI to follow, must be a String QName result
Exception
JSONException
public JSONResource json(XPathQuery path, Content aContent) throws Exception
path
- path to the URI to follow, must be a String QName resultaContent
- the content to POST
Exception
JSONException
public TextResource text(XPathQuery path) throws Exception
path
- path to the URI to follow, must be a String QName result
Exception
public TextResource text(XPathQuery path, Content aContent) throws Exception
path
- path to the URI to follow, must be a String QName resultaContent
- the content to POST
Exception
public XMLResource xml(XPathQuery path) throws Exception
path
- path to the URI to follow, must be a String QName result
Exception
public XMLResource xml(XPathQuery path, Content aContent) throws Exception
path
- path to the URI to follow, must be a String QName resultaContent
- the content to POST
Exception
public NodeList get(String xPath) throws Exception
Exception
public <T> T get(String xPath, Class<T> returnType) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |