public class JsonGsonFeature extends Object implements Feature
The Feature is automatically enabled when JsonGsonAutoDiscoverable is on classpath.
Default GSON configuration obtained by calling GsonBuilder.create() is used.
Custom configuration, if required, can be achieved by implementing custom ContextResolver and
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 and Description |
|---|
JsonGsonFeature() |
public boolean configure(FeatureContext context)
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.