org.jclouds.http.functions
Class ParseSax<T>

java.lang.Object
  extended by org.jclouds.http.functions.ParseSax<T>
All Implemented Interfaces:
com.google.common.base.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 type back to the caller.

Author:
Adrian Cole

Nested Class Summary
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
ParseSax(XMLReader parser, ParseSax.HandlerWithResult<T> handler)
           
 
Method Summary
 T addDetailsAndPropagate(HttpResponse response, Exception e)
           
 T apply(HttpResponse from)
           
protected  T doParse(InputSource from)
           
 ParseSax.HandlerWithResult<T> getHandler()
           
 T parse(InputSource from)
           
 T parse(InputStream from)
           
 T parse(String from)
           
 ParseSax<T> setContext(HttpRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Constructor Detail

ParseSax

@Inject
public ParseSax(XMLReader parser,
                       ParseSax.HandlerWithResult<T> handler)
Method Detail

apply

public T apply(HttpResponse from)
Specified by:
apply in interface com.google.common.base.Function<HttpResponse,T>

parse

public T parse(String from)

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)

getHandler

public ParseSax.HandlerWithResult<T> getHandler()

setContext

public ParseSax<T> setContext(HttpRequest request)
Specified by:
setContext in interface InvocationContext<ParseSax<T>>


Copyright © 2009-2011 jclouds. All Rights Reserved.