List of usage examples for org.springframework.http.codec ServerCodecConfigurer create
static ServerCodecConfigurer create()
From source file:org.springframework.cloud.function.web.function.FunctionEndpointInitializer.java
private DefaultErrorWebExceptionHandler errorHandler(GenericApplicationContext context) { context.registerBean(ErrorAttributes.class, () -> new DefaultErrorAttributes()); context.registerBean(ErrorProperties.class, () -> new ErrorProperties()); context.registerBean(ResourceProperties.class, () -> new ResourceProperties()); DefaultErrorWebExceptionHandler handler = new DefaultErrorWebExceptionHandler( context.getBean(ErrorAttributes.class), context.getBean(ResourceProperties.class), context.getBean(ErrorProperties.class), context); ServerCodecConfigurer codecs = ServerCodecConfigurer.create(); handler.setMessageWriters(codecs.getWriters()); handler.setMessageReaders(codecs.getReaders()); return handler; }
From source file:org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter.java
@Override public void afterPropertiesSet() throws Exception { Assert.notNull(this.applicationContext, "ApplicationContext is required"); if (CollectionUtils.isEmpty(this.messageReaders)) { ServerCodecConfigurer codecConfigurer = ServerCodecConfigurer.create(); this.messageReaders = codecConfigurer.getReaders(); }/* w w w .j a va 2 s . c om*/ if (this.argumentResolverConfigurer == null) { this.argumentResolverConfigurer = new ArgumentResolverConfigurer(); } if (this.reactiveAdapterRegistry == null) { this.reactiveAdapterRegistry = ReactiveAdapterRegistry.getSharedInstance(); } this.methodResolver = new ControllerMethodResolver(this.argumentResolverConfigurer, this.messageReaders, this.reactiveAdapterRegistry, this.applicationContext); this.modelInitializer = new ModelInitializer(this.methodResolver, this.reactiveAdapterRegistry); }
From source file:org.springframework.web.server.adapter.HttpWebHandlerAdapter.java
/** * Return the configured {@link ServerCodecConfigurer}. *//* w ww. j a v a 2s . co m*/ public ServerCodecConfigurer getCodecConfigurer() { return (this.codecConfigurer != null ? this.codecConfigurer : ServerCodecConfigurer.create()); }