Package org.jclouds.http.functions
Class ParseSax<T>
- java.lang.Object
-
- org.jclouds.http.functions.ParseSax<T>
-
- All Implemented Interfaces:
com.google.common.base.Function<HttpResponse,T>
,Function<HttpResponse,T>
,InvocationContext<ParseSax<T>>
public class ParseSax<T> extends Object implements com.google.common.base.Function<HttpResponse,T>, InvocationContext<ParseSax<T>>
This object will parse the body of an HttpResponse and return the result of typeback to the caller.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ParseSax.Factory
static class
ParseSax.HandlerForGeneratedRequestWithResult<T>
static class
ParseSax.HandlerWithResult<T>
Handler that produces a useable domain object accessible after parsing completes.
-
Constructor Summary
Constructors Constructor Description ParseSax(XMLReader parser, ParseSax.HandlerWithResult<T> handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
addDetailsAndPropagate(HttpResponse response, Exception e)
T
addDetailsAndPropagate(HttpResponse response, Exception e, String text)
T
apply(HttpResponse from)
protected T
doParse(InputSource from)
ParseSax.HandlerWithResult<T>
getHandler()
T
parse(InputStream from)
T
parse(String from)
T
parse(InputSource from)
ParseSax<T>
setContext(HttpRequest request)
-
-
-
Constructor Detail
-
ParseSax
public ParseSax(XMLReader parser, ParseSax.HandlerWithResult<T> handler)
-
-
Method Detail
-
apply
public T apply(HttpResponse from)
- Specified by:
apply
in interfacecom.google.common.base.Function<HttpResponse,T>
- Specified by:
apply
in interfaceFunction<HttpResponse,T>
-
parse
public T parse(InputStream from)
-
parse
public T parse(InputSource from)
-
doParse
protected T doParse(InputSource from) throws IOException, SAXException
- Throws:
IOException
SAXException
-
addDetailsAndPropagate
public T addDetailsAndPropagate(HttpResponse response, Exception e)
-
addDetailsAndPropagate
public T addDetailsAndPropagate(HttpResponse response, Exception e, @Nullable String text)
-
getHandler
public ParseSax.HandlerWithResult<T> getHandler()
-
setContext
public ParseSax<T> setContext(HttpRequest request)
- Specified by:
setContext
in interfaceInvocationContext<T>
-
-