org.springframework.http.MediaType#APPLICATION_XML源码实例Demo

下面列出了org.springframework.http.MediaType#APPLICATION_XML 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: ProtobufHttpMessageConverter.java
/**
 * Construct a new instance with an {@link ExtensionRegistryInitializer}
 * that allows the registration of message extensions.
 */
public ProtobufHttpMessageConverter(ExtensionRegistryInitializer registryInitializer) {
	super(PROTOBUF, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML);
	if (registryInitializer != null) {
		registryInitializer.initializeExtensionRegistry(this.extensionRegistry);
	}
}
 
/**
 * Construct a new instance with an {@link ExtensionRegistryInitializer}
 * that allows the registration of message extensions.
 */
public ProtobufHttpMessageConverter(ExtensionRegistryInitializer registryInitializer) {
	super(PROTOBUF, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON);
	if (registryInitializer != null) {
		registryInitializer.initializeExtensionRegistry(this.extensionRegistry);
	}
}
 
源代码3 项目: gocd   文件: XMLErrorMessageRendererTest.java
@Test
void shouldHandleRequest() {
    final XMLErrorMessageRenderer messageRenderer = new XMLErrorMessageRenderer(MediaType.APPLICATION_XML);
    assertThat(messageRenderer.getContentType()).isEqualTo(MediaType.APPLICATION_XML);
    assertThat(messageRenderer.getFormattedMessage("You are not authorized to access this URL. Some<xml>!")).isEqualTo("<access-denied>\n" +
            "  <message>You are not authorized to access this URL. Some&lt;xml&gt;!</message>\n" +
            "</access-denied>\n");
}
 
@Override
protected MediaType handleNoMatch(NativeWebRequest request, String mappingKey) {
	return "xml".equals(mappingKey) ? MediaType.APPLICATION_XML : null;
}
 
@Override
protected MediaType handleNoMatch(NativeWebRequest request, String mappingKey) {
	return "xml".equals(mappingKey) ? MediaType.APPLICATION_XML : null;
}
 
源代码6 项目: jfilter   文件: MethodParameterDetailsTest.java
@Test
public void testNotEquals() {
    MethodParameterDetails methodParameterDetails1 = new MethodParameterDetails(methodParameter, MediaType.APPLICATION_JSON, new FilterFields());
    MethodParameterDetails methodParameterDetails2 = new MethodParameterDetails(methodParameter, MediaType.APPLICATION_XML, null);
    assertNotEquals(methodParameterDetails1, methodParameterDetails2);
}
 
源代码7 项目: jfilter   文件: MethodParameterDetailsTest.java
@Test
public void testNotEqualsMediaType() {
    MethodParameterDetails methodParameterDetails1 = new MethodParameterDetails(methodParameter, MediaType.APPLICATION_JSON, null);
    MethodParameterDetails methodParameterDetails2 = new MethodParameterDetails(methodParameter, MediaType.APPLICATION_XML, null);
    assertNotEquals(methodParameterDetails1, methodParameterDetails2);
}
 
源代码8 项目: quarkus   文件: ExceptionThrowingController.java
@GetMapping("/re/void/xml")
public void voidWithResponseEntityExceptionAsXml() {
    throw new HandledResponseEntityException("bad state", MediaType.APPLICATION_XML);
}
 
@Override
protected MediaType handleNoMatch(NativeWebRequest request, String mappingKey) {
	return "xml".equals(mappingKey) ? MediaType.APPLICATION_XML : null;
}
 
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
源代码14 项目: lams   文件: AbstractXmlHttpMessageConverter.java
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
源代码15 项目: lams   文件: SourceHttpMessageConverter.java
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
源代码18 项目: sinavi-jfw   文件: Entity.java
/**
 * ContentTypeがapplication/xmlのヘッダとリクエストデータを設定します。
 * @param entity リクエストデータ
 * @param <T> リクエストデータの型
 * @return このユーティリティを返します。
 */
public static <T> Entity<T> xml(final T entity) {
    return new Entity<T>(entity, MediaType.APPLICATION_XML);
}