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 interfaceParseSax.Factorystatic classParseSax.HandlerForGeneratedRequestWithResult<T>static classParseSax.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 TaddDetailsAndPropagate(HttpResponse response, Exception e)TaddDetailsAndPropagate(HttpResponse response, Exception e, String text)Tapply(HttpResponse from)protected TdoParse(InputSource from)ParseSax.HandlerWithResult<T>getHandler()Tparse(InputStream from)Tparse(String from)Tparse(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:
applyin interfacecom.google.common.base.Function<HttpResponse,T>- Specified by:
applyin 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:
IOExceptionSAXException
-
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:
setContextin interfaceInvocationContext<T>
-
-