com.google.protobuf.gwt.shared
Class JsonStreamFactory

java.lang.Object
  extended by com.google.protobuf.gwt.shared.JsonStreamFactory
Direct Known Subclasses:
ClientJsonStreamFactory, ServerJsonStreamFactory

public abstract class JsonStreamFactory
extends Object

Factory interface that makes it easy to switch between different json strema implementations both on the client and on the server side.

Author:
vkulikov@alum.mit.edu Vitaliy Kulikov

Nested Class Summary
static class JsonStreamFactory.ImplementationType
           
 
Field Summary
static String COMPACT_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE
           
protected static JsonStreamFactory.ImplementationType DEFAULT_IMPLEMENTATION_TYPE
           
protected  JsonStreamFactory.ImplementationType implementationType
           
static String JSON_ENCODING_PARAMETER_KEY
           
static String VERBOSE_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE
           
 
Constructor Summary
protected JsonStreamFactory(JsonStreamFactory.ImplementationType implementationType)
           
 
Method Summary
 JsonStream createNewStream()
           
abstract  JsonStream createNewStream(JsonStreamFactory.ImplementationType implementationType)
           
abstract  JsonStream createNewStreamFromJson(String jsonText)
           
 JsonStream createNewStreamFromMessage(Message message)
           
 JsonStream createNewStreamFromMessage(Message message, JsonStreamFactory.ImplementationType implementationType)
           
 boolean equals(Object object)
           
 JsonStreamFactory.ImplementationType getImplementationType()
           
 String serializeMessage(Message message)
           
 String serializeMessage(Message message, JsonStreamFactory.ImplementationType implementationType)
           
 String serializeMessage(Message message, JsonStreamFactory.ImplementationType implementationType, boolean prettyPrint)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IMPLEMENTATION_TYPE

protected static final JsonStreamFactory.ImplementationType DEFAULT_IMPLEMENTATION_TYPE

JSON_ENCODING_PARAMETER_KEY

public static final String JSON_ENCODING_PARAMETER_KEY
See Also:
Constant Field Values

VERBOSE_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE

public static final String VERBOSE_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE
See Also:
Constant Field Values

COMPACT_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE

public static final String COMPACT_JSON_STREAM_IMPLEMENTATION_PARAMETER_VALUE
See Also:
Constant Field Values

implementationType

protected final JsonStreamFactory.ImplementationType implementationType
Constructor Detail

JsonStreamFactory

protected JsonStreamFactory(JsonStreamFactory.ImplementationType implementationType)
Method Detail

createNewStreamFromJson

public abstract JsonStream createNewStreamFromJson(String jsonText)

createNewStream

public abstract JsonStream createNewStream(JsonStreamFactory.ImplementationType implementationType)

getImplementationType

public JsonStreamFactory.ImplementationType getImplementationType()

createNewStream

public JsonStream createNewStream()

createNewStreamFromMessage

public JsonStream createNewStreamFromMessage(Message message)

createNewStreamFromMessage

public JsonStream createNewStreamFromMessage(Message message,
                                             JsonStreamFactory.ImplementationType implementationType)

serializeMessage

public String serializeMessage(Message message)

serializeMessage

public String serializeMessage(Message message,
                               JsonStreamFactory.ImplementationType implementationType)

serializeMessage

public String serializeMessage(Message message,
                               JsonStreamFactory.ImplementationType implementationType,
                               boolean prettyPrint)

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2014 InMobi. All rights reserved.