Package org.springframework.http.converter.json

Examples of org.springframework.http.converter.json.MappingJacksonHttpMessageConverter


    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(new StringHttpMessageConverter());
    messageConverters.add(new ResourceHttpMessageConverter());
    messageConverters.add(new UploadApplicationPayloadHttpMessageConverter());
    messageConverters.add(getFormHttpMessageConverter());
    messageConverters.add(new MappingJacksonHttpMessageConverter());
    return messageConverters;
  }
View Full Code Here


    if (bean instanceof AnnotationMethodHandlerAdapter) {
      AnnotationMethodHandlerAdapter adapter = (AnnotationMethodHandlerAdapter) bean;
      HttpMessageConverter<?>[] converters = adapter.getMessageConverters();
      for (HttpMessageConverter<?> converter : converters) {
        if (converter instanceof MappingJacksonHttpMessageConverter) {
          MappingJacksonHttpMessageConverter jsonConverter = (MappingJacksonHttpMessageConverter) converter;
          jsonConverter.setObjectMapper(new ConversionServiceAwareObjectMapper(this.conversionService));
        }       
      }
    }
    return bean;
  }
View Full Code Here

    return OAuth2Version.DRAFT_10;
  }
 
  @Override
  protected MappingJacksonHttpMessageConverter getJsonMessageConverter() {
    MappingJacksonHttpMessageConverter converter = super.getJsonMessageConverter();
    objectMapper = new ObjectMapper();       
    objectMapper.registerModule(new FoursquareModule());
    converter.setObjectMapper(objectMapper);   
    return converter;
  }
View Full Code Here

  public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
  }
 
  public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
    converters.add(new MappingJacksonHttpMessageConverter());
  }
View Full Code Here

  @Before
  public void setup() {
    template = new RestTemplate();
        final List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
        messageConverters.add(new MappingJacksonHttpMessageConverter());
        template.setMessageConverters(messageConverters);
  }
View Full Code Here

  @Override
  protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
    FormHttpMessageConverter formConverter = new FormHttpMessageConverter();
    formConverter.addPartConverter(new BufferedImageHttpMessageConverter());
    formConverter.addPartConverter(new MappingJacksonHttpMessageConverter());
    converters.add(formConverter);
  }
View Full Code Here

    this.messageConverters.add(new SourceHttpMessageConverter());
    if (jaxb2Present) {
      this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jacksonPresent) {
      this.messageConverters.add(new MappingJacksonHttpMessageConverter());
    }
  }
View Full Code Here

     */
    private RestTemplate getRestJsonTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        List<HttpMessageConverter<?>> mc = restTemplate.getMessageConverters();
        // Add JSON message handler
        MappingJacksonHttpMessageConverter json = new MappingJacksonHttpMessageConverter();
        List<MediaType> supportedMediaTypes = new ArrayList<MediaType>();
        supportedMediaTypes.add(new MediaType("application","json", Charset.forName("UTF-8")));
        // Add default media type in case marketplace uses incorrect MIME type, otherwise
        // Spring refuses to process it, even if its valid JSON
        supportedMediaTypes.add(new MediaType("application","octet-stream", Charset.forName("UTF-8")));
        json.setSupportedMediaTypes(supportedMediaTypes);
        mc.add(json);
        restTemplate.setMessageConverters(mc);
        return restTemplate;
    }
View Full Code Here

    this.messageConverters.add(new XmlAwareFormHttpMessageConverter());
    if (jaxb2Present) {
      this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jacksonPresent) {
      this.messageConverters.add(new MappingJacksonHttpMessageConverter());
    }
    if (romePresent) {
      this.messageConverters.add(new AtomFeedHttpMessageConverter());
      this.messageConverters.add(new RssChannelHttpMessageConverter());
    }
View Full Code Here

   static final Logger logger = Logger.getLogger(RestErrorHandler.class);
   private List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
   private final HttpMessageConverterExtractor<BddErrorMessage> delegate;

   RestErrorHandler() {
      messageConverters.add(new MappingJacksonHttpMessageConverter());
      delegate = new HttpMessageConverterExtractor<BddErrorMessage>(BddErrorMessage.class, messageConverters);
   }
View Full Code Here

TOP

Related Classes of org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.