Summary
Public Methods |
boolean
|
supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
|
[Expand]
Inherited Methods |
From class
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
|
From class
org.springframework.http.converter.AbstractHttpMessageConverter
boolean
|
canRead(Class<?> clazz, MediaType mediaType)
Indicates whether the given class can be read by this converter.
This implementation checks if the given class is supported ,
and if the supported media types
include the given media type.
|
boolean
|
canRead(MediaType mediaType)
|
boolean
|
canWrite(Class<?> clazz, MediaType mediaType)
Indicates whether the given class can be written by this converter.
This implementation checks if the given class is supported ,
and if the supported media types
include the given media type.
|
boolean
|
canWrite(MediaType mediaType)
|
Long
|
getContentLength(T t, MediaType contentType)
Returns the content length for the given type.
|
MediaType
|
getDefaultContentType(T t)
Returns the default content type for the given type.
|
List<MediaType>
|
getSupportedMediaTypes()
Return the list of MediaType objects supported by this converter.
|
final
T
|
read(Class<? extends T> clazz, HttpInputMessage inputMessage)
|
abstract
T
|
readInternal(Class<? extends T> clazz, HttpInputMessage inputMessage)
Abstract template method that reads the actualy object.
|
void
|
setSupportedMediaTypes(List<MediaType> supportedMediaTypes)
Set the list of MediaType objects supported by this converter.
|
abstract
boolean
|
supports(Class<?> clazz)
Indicates whether the given class is supported by this converter.
|
final
void
|
write(T t, MediaType contentType, HttpOutputMessage outputMessage)
|
abstract
void
|
writeInternal(T t, HttpOutputMessage outputMessage)
Abstract template method that writes the actual body.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.springframework.http.converter.HttpMessageConverter
|
Public Constructors
public
SourceHttpMessageConverter
()
Public Methods
public
boolean
supports
(Class<?> clazz)
Indicates whether the given class is supported by this converter.
Parameters
clazz
| the class to test for support |
Returns
true
if supported; false
otherwise
Protected Methods
protected
Long
getContentLength
(T t, MediaType contentType)
Returns the content length for the given type.
By default, this returns null
, meaning that the content length is unknown.
Can be overridden in subclasses.
Parameters
t
| the type to return the content length for |
Returns
- the content length, or
null
if not known
protected
T
readFromSource
(Class clazz, HttpHeaders headers, Source source)
Parameters
clazz
| the type of object to return |
headers
| the HTTP input headers |
source
| the HTTP input body |
protected
void
writeToResult
(T t, HttpHeaders headers, Result result)
Parameters
t
| the object to write to the output message |
headers
| the HTTP output headers |
result
| the HTTP output body |