com.google.api.client.http.protobuf
Class ProtoHttpParser

java.lang.Object
  extended by com.google.api.client.http.protobuf.ProtoHttpParser
All Implemented Interfaces:
HttpParser

Deprecated. (scheduled to be removed in 1.11) Use ProtoObjectParser instead.

@Deprecated
public class ProtoHttpParser
extends Object
implements HttpParser

Parses protocol buffer HTTP response content into a protocol buffer message.

Implementation is immutable and therefore thread-safe.

Sample usage:

 
  static void setParser(HttpRequest request) {
    request.addParser(new ProtoHttpParser());
  }
 
 

Since:
1.5
Author:
Yaniv Inbar

Nested Class Summary
static class ProtoHttpParser.Builder
          Deprecated. Builder for ProtoHttpParser.
 
Constructor Summary
  ProtoHttpParser()
          Deprecated.  
protected ProtoHttpParser(String contentType)
          Deprecated.  
 
Method Summary
static ProtoHttpParser.Builder builder()
          Deprecated. Returns an instance of a new builder.
 String getContentType()
          Deprecated. Returns the content type.
<T> T
parse(HttpResponse response, Class<T> dataClass)
          Deprecated. Parses the given HTTP response into a new instance of the the given data class of key/value pairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtoHttpParser

public ProtoHttpParser()
Deprecated. 

ProtoHttpParser

protected ProtoHttpParser(String contentType)
Deprecated. 
Parameters:
contentType - content type
Method Detail

getContentType

public final String getContentType()
Deprecated. 
Description copied from interface: HttpParser
Returns the content type.

Specified by:
getContentType in interface HttpParser

parse

public <T> T parse(HttpResponse response,
                   Class<T> dataClass)
        throws IOException
Deprecated. 
Description copied from interface: HttpParser
Parses the given HTTP response into a new instance of the the given data class of key/value pairs.

How the parsing is performed is not restricted by this interface, and is instead defined by the concrete implementation. Implementations should check HttpResponse.isSuccessStatusCode() to know whether they are parsing a success or error response.

Specified by:
parse in interface HttpParser
Throws:
IOException

builder

public static ProtoHttpParser.Builder builder()
Deprecated. 
Returns an instance of a new builder.



Copyright © 2011-2012 Google. All Rights Reserved.