public class GsonValueMapper extends Object implements ValueMapper, InputFieldBuilder
TYPE_METADATA_FIELD_NAME| Constructor and Description |
|---|
GsonValueMapper(com.google.gson.Gson gson) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
defaultValue(Field field,
AnnotatedType fieldType,
GlobalEnvironment environment) |
<T> T |
fromInput(Object graphQLInput,
Type sourceType,
AnnotatedType outputType) |
<T> T |
fromString(String json,
AnnotatedType type) |
protected String |
getDescription(Field field,
MessageBundle messageBundle) |
Set<InputField> |
getInputFields(InputFieldBuilderParams params)
Unlike Jackson, Gson doesn't expose any of its metadata, so this method is more or less a
reimplementation of
ReflectiveTypeAdapterFactory.getBoundFields(Gson, com.google.gson.reflect.TypeToken, Class) |
boolean |
supports(AnnotatedType type) |
String |
toString(Object output) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromInputpublic <T> T fromInput(Object graphQLInput, Type sourceType, AnnotatedType outputType) throws InputParsingException
fromInput in interface ValueMapperInputParsingExceptionpublic <T> T fromString(String json, AnnotatedType type)
fromString in interface ValueMapperpublic String toString(Object output)
toString in interface ValueMapperpublic Set<InputField> getInputFields(InputFieldBuilderParams params)
ReflectiveTypeAdapterFactory.getBoundFields(Gson, com.google.gson.reflect.TypeToken, Class)getInputFields in interface InputFieldBuilderparams - The parameters available to the discovery strategyAnnotatedTypeprotected String getDescription(Field field, MessageBundle messageBundle)
protected Object defaultValue(Field field, AnnotatedType fieldType, GlobalEnvironment environment)
public boolean supports(AnnotatedType type)
supports in interface InputFieldBuilderCopyright © 2016–2018. All rights reserved.