public class BHiveMapHttpMessageConverter extends Object implements org.springframework.http.converter.HttpMessageConverter<Map<String,?>>
FormHttpMessageConverter 계열이 MultiValueMap<String, ?>을 변환하여서
Map<String, ?>의 변환을 지원하기 위한 컨버터FormHttpMessageConverter| Modifier and Type | Field and Description |
|---|---|
static Charset |
DEFAULT_CHARSET |
| Constructor and Description |
|---|
BHiveMapHttpMessageConverter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPartConverter(org.springframework.http.converter.HttpMessageConverter<?> partConverter)
Add a message body converter.
|
boolean |
canRead(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
protected byte[] |
generateMultipartBoundary()
Generate a multipart boundary.
|
protected String |
getFilename(Object part)
Return the filename of the given multipart part.
|
protected org.springframework.http.HttpEntity<?> |
getHttpEntity(Object part)
Return an
HttpEntity for the given part Object. |
List<org.springframework.http.MediaType> |
getSupportedMediaTypes() |
Map<String,String> |
read(Class<? extends Map<String,?>> clazz,
org.springframework.http.HttpInputMessage inputMessage) |
void |
setCharset(Charset charset)
Set the default character set to use for reading and writing form data when
the request or response Content-Type header does not explicitly specify it.
|
void |
setMultipartCharset(Charset multipartCharset)
Set the character set to use when writing multipart data to encode file
names.
|
void |
setPartConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> partConverters)
Set the message body converters to use.
|
void |
setSupportedMediaTypes(List<org.springframework.http.MediaType> supportedMediaTypes)
Set the list of
MediaType objects supported by this converter. |
void |
write(Map<String,?> map,
org.springframework.http.MediaType contentType,
org.springframework.http.HttpOutputMessage outputMessage) |
public static final Charset DEFAULT_CHARSET
public void setCharset(Charset charset)
By default this is set to "UTF-8".
charset - Character Setpublic void setMultipartCharset(Charset multipartCharset)
MimeUtility from "javax.mail".
If not set file names will be encoded as US-ASCII.
multipartCharset - the charset to usepublic void setSupportedMediaTypes(List<org.springframework.http.MediaType> supportedMediaTypes)
MediaType objects supported by this converter.supportedMediaTypes - the MediaType list to usepublic List<org.springframework.http.MediaType> getSupportedMediaTypes()
public void setPartConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> partConverters)
partConverters - the HttpMessageConverter list to usepublic void addPartConverter(org.springframework.http.converter.HttpMessageConverter<?> partConverter)
partConverter - the HttpMessageConverter to usepublic boolean canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)
public boolean canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
public Map<String,String> read(Class<? extends Map<String,?>> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
read in interface org.springframework.http.converter.HttpMessageConverter<Map<String,?>>IOExceptionorg.springframework.http.converter.HttpMessageNotReadableExceptionpublic void write(Map<String,?> map, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
write in interface org.springframework.http.converter.HttpMessageConverter<Map<String,?>>IOExceptionorg.springframework.http.converter.HttpMessageNotWritableExceptionprotected byte[] generateMultipartBoundary()
The default implementation returns a random boundary. Can be overridden in subclasses.
protected org.springframework.http.HttpEntity<?> getHttpEntity(Object part)
HttpEntity for the given part Object.part - the part to return an HttpEntity forHttpEntity,
or a newly built HttpEntity wrapper for that partprotected String getFilename(Object part)
Content-Disposition header.
The default implementation returns Resource.getFilename() if the part is a
Resource, and null in other cases. Can be overridden in subclasses.
part - the part to determine the file name fornull if not knownCopyright © 2018. All rights reserved.