org.springframework.http.converter
Class FormHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<MultiValueMap<String,String>>
org.springframework.http.converter.FormHttpMessageConverter
- All Implemented Interfaces:
- HttpMessageConverter<MultiValueMap<String,String>>
public class FormHttpMessageConverter
- extends AbstractHttpMessageConverter<MultiValueMap<String,String>>
Implementation of HttpMessageConverter that can read and write form data.
By default, this converter reads and writes the media type (application/x-www-form-urlencoded). This can
be overridden by setting the supportedMediaTypes property. Form data
is read from and written into a MultiValueMap<String, String>.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
MultiValueMap
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CHARSET
public static final Charset DEFAULT_CHARSET
FormHttpMessageConverter
public FormHttpMessageConverter()
- Creates a new instance of the
FormHttpMessageConverter.
supports
public boolean supports(Class<?> clazz)
- Description copied from class:
AbstractHttpMessageConverter
- Indicates whether the given class is supported by this converter.
- Specified by:
supports in class AbstractHttpMessageConverter<MultiValueMap<String,String>>
- Parameters:
clazz - the class to test for support
- Returns:
true if supported; false otherwise
readInternal
public MultiValueMap<String,String> readInternal(Class clazz,
HttpInputMessage inputMessage)
throws IOException
- Description copied from class:
AbstractHttpMessageConverter
- Abstract template method that reads the actualy object. Invoked from
AbstractHttpMessageConverter.read(java.lang.Class extends T>, org.springframework.http.HttpInputMessage).
- Specified by:
readInternal in class AbstractHttpMessageConverter<MultiValueMap<String,String>>
- Parameters:
clazz - the type of object to returninputMessage - the HTTP input message to read from
- Returns:
- the converted object
- Throws:
IOException - in case of I/O errors
writeInternal
protected void writeInternal(MultiValueMap<String,String> form,
HttpOutputMessage outputMessage)
throws IOException
- Description copied from class:
AbstractHttpMessageConverter
- Abstract template method that writes the actual body. Invoked from
AbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage).
- Specified by:
writeInternal in class AbstractHttpMessageConverter<MultiValueMap<String,String>>
- Parameters:
form - the object to write to the output messageoutputMessage - the message to write to
- Throws:
IOException - in case of I/O errors