@Component public class GsonJSONSerialization extends java.lang.Object implements JSONSerialization
Modifier and Type | Field and Description |
---|---|
protected VraptorGsonBuilder |
builder |
protected TypeNameExtractor |
extractor |
protected ProxyInitializer |
initializer |
protected javax.servlet.http.HttpServletResponse |
response |
Constructor and Description |
---|
GsonJSONSerialization(javax.servlet.http.HttpServletResponse response,
TypeNameExtractor extractor,
ProxyInitializer initializer,
java.util.Collection<com.google.gson.JsonSerializer<?>> serializers,
java.util.Collection<com.google.gson.ExclusionStrategy> exclusions) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.String format) |
<T> Serializer |
from(T object)
Serializes this object to the clients writer with out ROOT alias.
|
<T> Serializer |
from(T object,
java.lang.String alias)
Serializes this object to the clients writer, with a given alias.
|
protected SerializerBuilder |
getSerializer() |
JSONSerialization |
indented() |
<T> NoRootSerialization |
withoutRoot()
You can override this method for configuring Driver before serialization
|
protected final javax.servlet.http.HttpServletResponse response
protected final TypeNameExtractor extractor
protected final ProxyInitializer initializer
protected final VraptorGsonBuilder builder
public GsonJSONSerialization(javax.servlet.http.HttpServletResponse response, TypeNameExtractor extractor, ProxyInitializer initializer, java.util.Collection<com.google.gson.JsonSerializer<?>> serializers, java.util.Collection<com.google.gson.ExclusionStrategy> exclusions)
public boolean accepts(java.lang.String format)
accepts
in interface Serialization
public <T> Serializer from(T object)
NoRootSerialization
from
in interface NoRootSerialization
public <T> Serializer from(T object, java.lang.String alias)
Serialization
from
in interface Serialization
protected SerializerBuilder getSerializer()
public <T> NoRootSerialization withoutRoot()
withoutRoot
in interface JSONSerialization
public JSONSerialization indented()
indented
in interface JSONSerialization
Copyright © 2013 Caelum. All Rights Reserved.