Package org.glassfish.jersey.gson
Class JsonGsonFeature
- java.lang.Object
-
- org.glassfish.jersey.gson.JsonGsonFeature
-
- All Implemented Interfaces:
Feature
public class JsonGsonFeature extends Object implements Feature
Feature used to register Gson providers.The Feature is automatically enabled when
JsonGsonAutoDiscoverableis on classpath. Default GSON configuration obtained by callingGsonBuilder.create()is used.Custom configuration, if required, can be achieved by implementing custom
ContextResolverand registering it as a provider into JAX-RS runtime:@Provider @class GsonContextResolver implements ContextResolver<Gson> { @Override public Gson getContext(Class> type) { GsonBuilder builder = new GsonBuilder(); // add custom configuration return builder.create(); } }
-
-
Constructor Summary
Constructors Constructor Description JsonGsonFeature()
-
-
-
Method Detail
-
configure
public boolean configure(FeatureContext context)
-
-