public class JsonGsonFeature extends Object implements javax.ws.rs.core.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() |
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.