spring-framework / org.springframework.http.converter.xml / SourceHttpMessageConverter

SourceHttpMessageConverter

open class SourceHttpMessageConverter<T : Source> : AbstractHttpMessageConverter<T>

Implementation of org.springframework.http.converter.HttpMessageConverter that can read and write Source objects.

Author
Arjen Poutsma

Author
Rossen Stoyanchev

Since
3.0

Constructors

<init>

SourceHttpMessageConverter()

Sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.

Functions

isProcessExternalEntities

open fun isProcessExternalEntities(): Boolean

Returns the configured value for whether XML external entities are allowed.

isSupportDtd

open fun isSupportDtd(): Boolean

Whether DTD parsing is supported.

setProcessExternalEntities

open fun setProcessExternalEntities(processExternalEntities: Boolean): Unit

Indicates whether external XML entities are processed when converting to a Source.

Default is false, meaning that external entities are not resolved.

Note: setting this option to true also automatically sets #setSupportDtd to true.

setSupportDtd

open fun setSupportDtd(supportDtd: Boolean): Unit

Indicates whether DTD parsing should be supported.

Default is false meaning that DTD is disabled.

supports

open fun supports(clazz: Class<*>): Boolean