Java 类org.springframework.http.converter.xml.SourceHttpMessageConverter 实例源码

项目:class-guard    文件:WebMvcConfigurationSupport.java   
/**
 * Adds a set of default HttpMessageConverter instances to the given list.
 * Subclasses can call this method from {@link #configureMessageConverters(List)}.
 * @param messageConverters the list to add the default message converters to
 */
protected final void addDefaultHttpMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
    StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
    stringConverter.setWriteAcceptCharset(false);

    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(stringConverter);
    messageConverters.add(new ResourceHttpMessageConverter());
    messageConverters.add(new SourceHttpMessageConverter<Source>());
    messageConverters.add(new AllEncompassingFormHttpMessageConverter());

    if (romePresent) {
        messageConverters.add(new AtomFeedHttpMessageConverter());
        messageConverters.add(new RssChannelHttpMessageConverter());
    }
    if (jaxb2Present) {
        messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jackson2Present) {
        messageConverters.add(new MappingJackson2HttpMessageConverter());
    }
    else if (jacksonPresent) {
        messageConverters.add(new MappingJacksonHttpMessageConverter());
    }
}
项目:lams    文件:RestTemplate.java   
/**
 * Create a new instance of the {@link RestTemplate} using default settings.
 * Default {@link HttpMessageConverter}s are initialized.
 */
@SuppressWarnings("deprecation")
public RestTemplate() {
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(new StringHttpMessageConverter());
    this.messageConverters.add(new ResourceHttpMessageConverter());
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());

    if (romePresent) {
        this.messageConverters.add(new AtomFeedHttpMessageConverter());
        this.messageConverters.add(new RssChannelHttpMessageConverter());
    }
    if (jaxb2Present) {
        this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jackson2Present) {
        this.messageConverters.add(new MappingJackson2HttpMessageConverter());
    }
    else if (jacksonPresent) {
        this.messageConverters.add(new org.springframework.http.converter.json.MappingJacksonHttpMessageConverter());
    }
}
项目:oma-riista-web    文件:MMLWebFeatureServiceRequestTemplate.java   
public MMLWebFeatureServiceRequestTemplate(MMLProperties mmlProperties, ClientHttpRequestFactory clientHttpRequestFactory) {
    this.mmlProperties = mmlProperties;
    this.restTemplate = new RestTemplate(clientHttpRequestFactory);

    final List<MediaType> xmlMediaTypes = Lists.newArrayList(
            MediaType.APPLICATION_XML, MediaType.TEXT_XML,
            new MediaType("application", "*+xml"),
            new MediaType("application", "vnd.ogc.se_xml"));

    final SourceHttpMessageConverter<Source> xmlConverter = new SourceHttpMessageConverter<>();
    xmlConverter.setSupportedMediaTypes(xmlMediaTypes);

    final List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
    messageConverters.add(xmlConverter);

    final List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
    interceptors.add(new BasicAuthenticationClientInterceptor(
            mmlProperties.getWfsUsername(), mmlProperties.getWfsPassword()));

    this.restTemplate.setMessageConverters(messageConverters);
    this.restTemplate.setInterceptors(interceptors);
}
项目:oma-riista-web    文件:WebMVCConfig.java   
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
    final MappingJackson2HttpMessageConverter jsonMessageConverter = jacksonMessageConverter();

    final StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
    stringHttpMessageConverter.setWriteAcceptCharset(false);

    messageConverters.add(new CSVMessageConverter());
    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(stringHttpMessageConverter);
    messageConverters.add(new ResourceHttpMessageConverter());
    messageConverters.add(new SourceHttpMessageConverter<>());
    messageConverters.add(new AllEncompassingFormHttpMessageConverter());
    messageConverters.add(jsonMessageConverter);
    messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
}
项目:spring4-understanding    文件:AllEncompassingFormHttpMessageConverter.java   
public AllEncompassingFormHttpMessageConverter() {
    addPartConverter(new SourceHttpMessageConverter<Source>());

    if (jaxb2Present && !jackson2Present) {
        addPartConverter(new Jaxb2RootElementHttpMessageConverter());
    }

    if (jackson2Present) {
        addPartConverter(new MappingJackson2HttpMessageConverter());
    }
    else if (gsonPresent) {
        addPartConverter(new GsonHttpMessageConverter());
    }

    if (jackson2XmlPresent) {
        addPartConverter(new MappingJackson2XmlHttpMessageConverter());
    }
}
项目:contestparser    文件:HttpMessageConvertersTests.java   
@Test
public void containsDefaults() throws Exception {
    HttpMessageConverters converters = new HttpMessageConverters();
    List<Class<?>> converterClasses = new ArrayList<Class<?>>();
    for (HttpMessageConverter<?> converter : converters) {
        converterClasses.add(converter.getClass());
    }
    assertThat(converterClasses,
            equalTo(Arrays.<Class<?>>asList(ByteArrayHttpMessageConverter.class,
                    StringHttpMessageConverter.class,
                    ResourceHttpMessageConverter.class,
                    SourceHttpMessageConverter.class,
                    AllEncompassingFormHttpMessageConverter.class,
                    MappingJackson2HttpMessageConverter.class,
                    MappingJackson2XmlHttpMessageConverter.class)));
}
项目:crnk-framework    文件:SpringParameterProvider.java   
private List<HttpMessageConverter<?>> getHttpMessageConverters() {
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);  // see SPR-7316

    List<HttpMessageConverter<?>> converters = new ArrayList<>(4);
    converters.add(new ByteArrayHttpMessageConverter());
    converters.add(stringHttpMessageConverter);
    converters.add(new SourceHttpMessageConverter<>());
    converters.add(new AllEncompassingFormHttpMessageConverter());

    return converters;
}
项目:lams    文件:AllEncompassingFormHttpMessageConverter.java   
@SuppressWarnings("deprecation")
public AllEncompassingFormHttpMessageConverter() {
    addPartConverter(new SourceHttpMessageConverter<Source>());
    if (jaxb2Present) {
        addPartConverter(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jackson2Present) {
        addPartConverter(new MappingJackson2HttpMessageConverter());
    }
    else if (jacksonPresent) {
        addPartConverter(new org.springframework.http.converter.json.MappingJacksonHttpMessageConverter());
    }
}
项目:spring4-understanding    文件:AnnotationMethodHandlerAdapter.java   
public AnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter<?>[] {
        new ByteArrayHttpMessageConverter(), stringHttpMessageConverter,
        new SourceHttpMessageConverter<Source>(),
        new org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter() };
}
项目:spring4-understanding    文件:ExceptionHandlerExceptionResolver.java   
public ExceptionHandlerExceptionResolver() {
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false); // See SPR-7316

    this.messageConverters = new ArrayList<HttpMessageConverter<?>>();
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(stringHttpMessageConverter);
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
}
项目:spring4-understanding    文件:RequestMappingHandlerAdapter.java   
public RequestMappingHandlerAdapter() {
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);  // see SPR-7316

    this.messageConverters = new ArrayList<HttpMessageConverter<?>>(4);
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(stringHttpMessageConverter);
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
}
项目:spring4-understanding    文件:RestTemplate.java   
/**
 * Create a new instance of the {@link RestTemplate} using default settings.
 * Default {@link HttpMessageConverter}s are initialized.
 */
public RestTemplate() {
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(new StringHttpMessageConverter());
    this.messageConverters.add(new ResourceHttpMessageConverter());
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());

    if (romePresent) {
        this.messageConverters.add(new AtomFeedHttpMessageConverter());
        this.messageConverters.add(new RssChannelHttpMessageConverter());
    }

    if (jackson2XmlPresent) {
        this.messageConverters.add(new MappingJackson2XmlHttpMessageConverter());
    }
    else if (jaxb2Present) {
        this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }

    if (jackson2Present) {
        this.messageConverters.add(new MappingJackson2HttpMessageConverter());
    }
    else if (gsonPresent) {
        this.messageConverters.add(new GsonHttpMessageConverter());
    }
}
项目:katharsis-framework    文件:SpringParameterProvider.java   
private List<HttpMessageConverter<?>> getHttpMessageConverters() {
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);  // see SPR-7316

    List<HttpMessageConverter<?>> converters = new ArrayList<>(4);
    converters.add(new ByteArrayHttpMessageConverter());
    converters.add(stringHttpMessageConverter);
    converters.add(new SourceHttpMessageConverter<>());
    converters.add(new AllEncompassingFormHttpMessageConverter());

    return converters;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HttpMessageConvertersTests.java   
@Test
public void containsDefaults() throws Exception {
    HttpMessageConverters converters = new HttpMessageConverters();
    List<Class<?>> converterClasses = new ArrayList<Class<?>>();
    for (HttpMessageConverter<?> converter : converters) {
        converterClasses.add(converter.getClass());
    }
    assertThat(converterClasses).containsExactly(ByteArrayHttpMessageConverter.class,
            StringHttpMessageConverter.class, ResourceHttpMessageConverter.class,
            SourceHttpMessageConverter.class,
            AllEncompassingFormHttpMessageConverter.class,
            MappingJackson2HttpMessageConverter.class,
            MappingJackson2XmlHttpMessageConverter.class);
}
项目:java-platform    文件:WebConfiguration.java   
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
    StringHttpMessageConverter stringConverter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
    stringConverter.setWriteAcceptCharset(false);

    converters.add(new ByteArrayHttpMessageConverter());
    converters.add(stringConverter);
    converters.add(new ResourceHttpMessageConverter());
    converters.add(new SourceHttpMessageConverter<Source>());
    converters.add(new AllEncompassingFormHttpMessageConverter());
}
项目:spring-boot-concourse    文件:HttpMessageConvertersTests.java   
@Test
public void containsDefaults() throws Exception {
    HttpMessageConverters converters = new HttpMessageConverters();
    List<Class<?>> converterClasses = new ArrayList<Class<?>>();
    for (HttpMessageConverter<?> converter : converters) {
        converterClasses.add(converter.getClass());
    }
    assertThat(converterClasses).containsExactly(ByteArrayHttpMessageConverter.class,
            StringHttpMessageConverter.class, ResourceHttpMessageConverter.class,
            SourceHttpMessageConverter.class,
            AllEncompassingFormHttpMessageConverter.class,
            MappingJackson2HttpMessageConverter.class,
            MappingJackson2XmlHttpMessageConverter.class);
}
项目:ShoppingMall    文件:RestTemplate.java   
public static void init(List<HttpMessageConverter<?>> messageConverters) {
    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(new StringHttpMessageConverter());
    messageConverters.add(new ResourceHttpMessageConverter());

    // if javax.xml.transform is not available, fall back to standard Form message converter
    if (javaxXmlTransformPresent) {
        messageConverters.add(new SourceHttpMessageConverter<Source>());
        messageConverters.add(new XmlAwareFormHttpMessageConverter());
    } else {
        messageConverters.add(new FormHttpMessageConverter());
    }

    if (simpleXmlPresent) {
        messageConverters.add(new SimpleXmlHttpMessageConverter());
    }

    if (jackson2Present) {
        messageConverters.add(new MappingJackson2HttpMessageConverter());
    } else if (jacksonPresent) {
        messageConverters.add(new MappingJacksonHttpMessageConverter());
    }

    if (romePresent) {
        messageConverters.add(new SyndFeedHttpMessageConverter());
    }
}
项目:nakadi    文件:WebConfig.java   
@Override
protected void configureMessageConverters(final List<HttpMessageConverter<?>> converters) {
    final StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
    stringConverter.setWriteAcceptCharset(false);

    converters.add(new ByteArrayHttpMessageConverter());
    converters.add(stringConverter);
    converters.add(new ResourceHttpMessageConverter());
    converters.add(new SourceHttpMessageConverter<>());

    converters.add(mappingJackson2HttpMessageConverter());
    super.configureMessageConverters(converters);
}
项目:sdk-rest    文件:RestTemplateFactory.java   
private static RestTemplate createRestTemplate() {
    List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(new StringHttpMessageConverter(Charset.forName("UTF-8")));
    messageConverters.add(new ResourceHttpMessageConverter());
    messageConverters.add(new SourceHttpMessageConverter<Source>());
    messageConverters.add(new AllEncompassingFormHttpMessageConverter());
    messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    messageConverters.add(new MappingJackson2HttpMessageConverter());

    return new RestTemplate(messageConverters);
}
项目:mcs    文件:MatchmakerCloudSearchConfiguration.java   
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
  converters.add(new ByteArrayHttpMessageConverter());
  converters.add(stringMessageConverter());
  converters.add(new SourceHttpMessageConverter<>());
  converters.add(new AllEncompassingFormHttpMessageConverter());
  converters.add(messageConverter());
}
项目:mybus    文件:WebApplicationConfig.java   
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
    StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
    stringConverter.setWriteAcceptCharset(false);
    converters.add(new ByteArrayHttpMessageConverter());
    converters.add(stringConverter);
    converters.add(new ResourceHttpMessageConverter());
    converters.add(new SourceHttpMessageConverter<Source>());
    converters.add(new AllEncompassingFormHttpMessageConverter());

    converters.add(mappingJackson2HttpMessageConverter());
    super.configureMessageConverters(converters);
}
项目:community-edition-old    文件:FlickrTemplate.java   
@Override
protected List<HttpMessageConverter<?>> getMessageConverters()
{
    List<HttpMessageConverter<?>> messageConverters = super.getMessageConverters();
    messageConverters.add(new ByteArrayHttpMessageConverter());
    messageConverters.add(new SourceHttpMessageConverter<Source>());
    messageConverters.add(new JaxbHttpMessageConverter("org.alfresco.repo.publishing.flickr.springsocial.api.impl.xml"));
    return messageConverters;
}
项目:class-guard    文件:AnnotationMethodHandlerAdapter.java   
public AnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter[]{new ByteArrayHttpMessageConverter(), stringHttpMessageConverter,
            new SourceHttpMessageConverter(), new XmlAwareFormHttpMessageConverter()};
}
项目:class-guard    文件:ExceptionHandlerExceptionResolver.java   
/**
 * Default constructor.
 */
public ExceptionHandlerExceptionResolver() {

    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false); // See SPR-7316

    this.messageConverters = new ArrayList<HttpMessageConverter<?>>();
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(stringHttpMessageConverter);
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
}
项目:class-guard    文件:RequestMappingHandlerAdapter.java   
/**
 * Default constructor.
 */
public RequestMappingHandlerAdapter() {

    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false); // See SPR-7316

    this.messageConverters = new ArrayList<HttpMessageConverter<?>>();
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(stringHttpMessageConverter);
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());
}
项目:class-guard    文件:AnnotationDrivenBeanDefinitionParser.java   
private ManagedList<?> getMessageConverters(Element element, Object source, ParserContext parserContext) {
    Element convertersElement = DomUtils.getChildElementByTagName(element, "message-converters");
    ManagedList<? super Object> messageConverters = new ManagedList<Object>();
    if (convertersElement != null) {
        messageConverters.setSource(source);
        for (Element beanElement : DomUtils.getChildElementsByTagName(convertersElement, "bean", "ref")) {
            Object object = parserContext.getDelegate().parsePropertySubElement(beanElement, null);
            messageConverters.add(object);
        }
    }

    if (convertersElement == null || Boolean.valueOf(convertersElement.getAttribute("register-defaults"))) {
        messageConverters.setSource(source);
        messageConverters.add(createConverterDefinition(ByteArrayHttpMessageConverter.class, source));

        RootBeanDefinition stringConverterDef = createConverterDefinition(StringHttpMessageConverter.class, source);
        stringConverterDef.getPropertyValues().add("writeAcceptCharset", false);
        messageConverters.add(stringConverterDef);

        messageConverters.add(createConverterDefinition(ResourceHttpMessageConverter.class, source));
        messageConverters.add(createConverterDefinition(SourceHttpMessageConverter.class, source));
        messageConverters.add(createConverterDefinition(AllEncompassingFormHttpMessageConverter.class, source));

        if (romePresent) {
            messageConverters.add(createConverterDefinition(AtomFeedHttpMessageConverter.class, source));
            messageConverters.add(createConverterDefinition(RssChannelHttpMessageConverter.class, source));
        }
        if (jaxb2Present) {
            messageConverters.add(createConverterDefinition(Jaxb2RootElementHttpMessageConverter.class, source));
        }
        if (jackson2Present) {
            messageConverters.add(createConverterDefinition(MappingJackson2HttpMessageConverter.class, source));
        }
        else if (jacksonPresent) {
            messageConverters.add(createConverterDefinition(MappingJacksonHttpMessageConverter.class, source));
        }
    }
    return messageConverters;
}
项目:class-guard    文件:RestTemplate.java   
/**
 * Create a new instance of the {@link RestTemplate} using default settings.
 * Default {@link HttpMessageConverter}s are initialized.
 */
public RestTemplate() {
    this.messageConverters.add(new ByteArrayHttpMessageConverter());
    this.messageConverters.add(new StringHttpMessageConverter());
    this.messageConverters.add(new ResourceHttpMessageConverter());
    this.messageConverters.add(new SourceHttpMessageConverter<Source>());
    this.messageConverters.add(new AllEncompassingFormHttpMessageConverter());

    if (romePresent) {
        this.messageConverters.add(new AtomFeedHttpMessageConverter());
        this.messageConverters.add(new RssChannelHttpMessageConverter());
    }
    if (jaxb2Present) {
        this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jackson2Present) {
        this.messageConverters.add(new MappingJackson2HttpMessageConverter());
    }
    else if (jacksonPresent) {
        this.messageConverters.add(new MappingJacksonHttpMessageConverter());
    }
}
项目:class-guard    文件:AllEncompassingFormHttpMessageConverter.java   
public AllEncompassingFormHttpMessageConverter() {
    addPartConverter(new SourceHttpMessageConverter());
    if (jaxb2Present) {
        addPartConverter(new Jaxb2RootElementHttpMessageConverter());
    }
    if (jackson2Present) {
        addPartConverter(new MappingJackson2HttpMessageConverter());
    }
    else if (jacksonPresent) {
        addPartConverter(new MappingJacksonHttpMessageConverter());
    }
}
项目:jresplus    文件:ExtendableAnnotationMethodHandlerAdapter.java   
@SuppressWarnings("rawtypes")
public ExtendableAnnotationMethodHandlerAdapter() {
    // no restriction of HTTP methods by default
    super(false);

    // See SPR-7316
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    this.messageConverters = new HttpMessageConverter[] {
            new ByteArrayHttpMessageConverter(),
            stringHttpMessageConverter, new SourceHttpMessageConverter(),
            new XmlAwareFormHttpMessageConverter() };
}
项目:molgenis    文件:HttpClientConfig.java   
private List<HttpMessageConverter<?>> converters()
{
    List<HttpMessageConverter<?>> result = Lists.newArrayList();
    result.add(new ByteArrayHttpMessageConverter());
    result.add(new StringHttpMessageConverter());
    result.add(new ResourceHttpMessageConverter());
    result.add(new SourceHttpMessageConverter<>());
    result.add(new AllEncompassingFormHttpMessageConverter());
    result.add(new Jaxb2RootElementHttpMessageConverter());
    result.add(gsonHttpMessageConverter);
    return result;
}
项目:editor-de-servicos    文件:WebMVCConfig.java   
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
    converters.add(new SourceHttpMessageConverter<>());
}