|
40 | 40 | import org.springframework.core.ParameterizedTypeReference;
|
41 | 41 | import org.springframework.core.ResolvableType;
|
42 | 42 | import org.springframework.core.annotation.AnnotatedElementUtils;
|
43 |
| -import org.springframework.core.codec.Decoder; |
44 |
| -import org.springframework.core.codec.Encoder; |
45 | 43 | import org.springframework.graphql.data.method.HandlerMethod;
|
46 | 44 | import org.springframework.graphql.data.method.HandlerMethodArgumentResolver;
|
47 | 45 | import org.springframework.graphql.data.method.HandlerMethodArgumentResolverComposite;
|
|
50 | 48 | import org.springframework.graphql.data.method.annotation.SchemaMapping;
|
51 | 49 | import org.springframework.graphql.data.method.annotation.SubscriptionMapping;
|
52 | 50 | import org.springframework.graphql.execution.RuntimeWiringConfigurer;
|
53 |
| -import org.springframework.http.MediaType; |
54 |
| -import org.springframework.http.codec.DecoderHttpMessageReader; |
55 |
| -import org.springframework.http.codec.EncoderHttpMessageWriter; |
56 |
| -import org.springframework.http.codec.ServerCodecConfigurer; |
57 |
| -import org.springframework.http.converter.GenericHttpMessageConverter; |
58 | 51 | import org.springframework.lang.Nullable;
|
59 | 52 | import org.springframework.stereotype.Controller;
|
60 | 53 | import org.springframework.util.Assert;
|
@@ -97,58 +90,6 @@ public class AnnotatedDataFetcherConfigurer
|
97 | 90 | @Nullable
|
98 | 91 | private HandlerMethodArgumentResolverComposite argumentResolvers;
|
99 | 92 |
|
100 |
| - @Nullable |
101 |
| - private GenericHttpMessageConverter<Object> jsonMessageConverter; |
102 |
| - |
103 |
| - @Nullable |
104 |
| - private Encoder<Object> jsonEncoder; |
105 |
| - |
106 |
| - @Nullable |
107 |
| - private Decoder<Object> jsonDecoder; |
108 |
| - |
109 |
| - |
110 |
| - /** |
111 |
| - * Configure the {@link org.springframework.http.converter.HttpMessageConverter} |
112 |
| - * to use to convert input arguments obtained from the |
113 |
| - * {@link DataFetchingEnvironment} and converted to the type of a declared |
114 |
| - * {@link org.springframework.graphql.data.method.annotation.Argument @Argument} |
115 |
| - * method parameter. |
116 |
| - * <p>This method is mutually exclusive with |
117 |
| - * {@link #setServerCodecConfigurer(ServerCodecConfigurer)} and is convenient |
118 |
| - * for use in a Spring MVC application but both variant can be used without |
119 |
| - * much difference. |
120 |
| - * @param converter the converter to use. |
121 |
| - */ |
122 |
| - public void setJsonMessageConverter(@Nullable GenericHttpMessageConverter<Object> converter) { |
123 |
| - this.jsonMessageConverter = converter; |
124 |
| - } |
125 |
| - |
126 |
| - /** |
127 |
| - * Variant of {@link #setJsonMessageConverter(GenericHttpMessageConverter)} |
128 |
| - * to use an {@link Encoder} and {@link Decoder} to convert input arguments. |
129 |
| - * <p>This method is mutually exclusive with |
130 |
| - * {@link #setJsonMessageConverter(GenericHttpMessageConverter)} and is |
131 |
| - * convenient for use in a Spring WebFlux application but both variant can |
132 |
| - * be used without much difference. |
133 |
| - */ |
134 |
| - @SuppressWarnings("unchecked") |
135 |
| - public void setServerCodecConfigurer(@Nullable ServerCodecConfigurer configurer) { |
136 |
| - if (configurer == null) { |
137 |
| - this.jsonDecoder = null; |
138 |
| - this.jsonEncoder = null; |
139 |
| - return; |
140 |
| - } |
141 |
| - this.jsonDecoder = configurer.getReaders().stream() |
142 |
| - .filter((reader) -> reader.canRead(MAP_RESOLVABLE_TYPE, MediaType.APPLICATION_JSON)) |
143 |
| - .map((reader) -> ((DecoderHttpMessageReader<Object>) reader).getDecoder()) |
144 |
| - .findFirst() |
145 |
| - .orElseThrow(() -> new IllegalArgumentException("No Decoder for JSON")); |
146 |
| - this.jsonEncoder = configurer.getWriters().stream() |
147 |
| - .filter((writer) -> writer.canWrite(MAP_RESOLVABLE_TYPE, MediaType.APPLICATION_JSON)) |
148 |
| - .map((writer) -> ((EncoderHttpMessageWriter<Object>) writer).getEncoder()) |
149 |
| - .findFirst() |
150 |
| - .orElseThrow(() -> new IllegalArgumentException("No Encoder for JSON")); |
151 |
| - } |
152 | 93 |
|
153 | 94 | @Override
|
154 | 95 | public void setApplicationContext(ApplicationContext applicationContext) {
|
|
0 commit comments