类 ExtensionFormHttpMessageConverter
- java.lang.Object
-
- org.springframework.http.converter.FormHttpMessageConverter
-
- cn.crushes.cloud.core.pay.wechat.v3.ExtensionFormHttpMessageConverter
-
- 所有已实现的接口:
org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<String,?>>
final class ExtensionFormHttpMessageConverter extends org.springframework.http.converter.FormHttpMessageConverter用于微信支付处理上传的自定义消息转换器.- 作者:
- youta
- 另请参阅:
AllEncompassingFormHttpMessageConverter
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 private static classExtensionFormHttpMessageConverter.MultipartHttpOutputMessageThe type Multipart http output message.
-
字段概要
字段 修饰符和类型 字段 说明 private static StringBOUNDARYThe constant BOUNDARY.private static booleanGSON_PRESENTThe constant gsonPresent.private static booleanJACKSON_2_PRESENTThe constant jackson2Present.private static booleanJACKSON_2_SMILE_PRESENTThe constant jackson2SmilePresent.private static booleanJACKSON_2_XML_PRESENTThe constant jackson2XmlPresent.private static booleanJAXB_2_PRESENTThe constant jaxb2Present.private static booleanJSONB_PRESENTThe constant jsonbPresent.private List<org.springframework.http.converter.HttpMessageConverter<?>>partConvertersThe Part converters.
-
构造器概要
构造器 构造器 说明 ExtensionFormHttpMessageConverter()Instantiates a new Upload http message converter.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 private voidapplyDefaultCharset()Apply the configured charset as a default to registered part converters.private org.springframework.http.MediaTypegetMediaType(org.springframework.http.MediaType mediaType)Gets media type.private booleanisMultipart(org.springframework.util.MultiValueMap<String,?> map, org.springframework.http.MediaType contentType)Is multipart boolean.voidwrite(org.springframework.util.MultiValueMap<String,?> map, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage)private voidwriteBoundary(OutputStream os, byte[] boundary)Write boundary.private static voidwriteEnd(OutputStream os, byte[] boundary)Write end.private voidwriteForm(org.springframework.util.MultiValueMap<String,Object> formData, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage)Write form.private voidwriteMultipart(org.springframework.util.MultiValueMap<String,Object> parts, org.springframework.http.HttpOutputMessage outputMessage)Write multipart.private static voidwriteNewLine(OutputStream os)Write new line.private voidwritePart(String name, org.springframework.http.HttpEntity<?> partEntity, OutputStream os)Write part.private voidwriteParts(OutputStream os, org.springframework.util.MultiValueMap<String,Object> parts, byte[] boundary)Write parts.-
从类继承的方法 org.springframework.http.converter.FormHttpMessageConverter
addPartConverter, addSupportedMediaTypes, canRead, canWrite, generateMultipartBoundary, getFilename, getFormContentType, getHttpEntity, getPartConverters, getSupportedMediaTypes, read, serializeForm, setCharset, setMultipartCharset, setPartConverters, setSupportedMediaTypes
-
-
-
-
字段详细资料
-
JAXB_2_PRESENT
private static final boolean JAXB_2_PRESENT
The constant jaxb2Present.
-
JACKSON_2_PRESENT
private static final boolean JACKSON_2_PRESENT
The constant jackson2Present.
-
JACKSON_2_XML_PRESENT
private static final boolean JACKSON_2_XML_PRESENT
The constant jackson2XmlPresent.
-
JACKSON_2_SMILE_PRESENT
private static final boolean JACKSON_2_SMILE_PRESENT
The constant jackson2SmilePresent.
-
GSON_PRESENT
private static final boolean GSON_PRESENT
The constant gsonPresent.
-
JSONB_PRESENT
private static final boolean JSONB_PRESENT
The constant jsonbPresent.
-
partConverters
private final List<org.springframework.http.converter.HttpMessageConverter<?>> partConverters
The Part converters.
-
-
方法详细资料
-
applyDefaultCharset
private void applyDefaultCharset()
Apply the configured charset as a default to registered part converters.
-
write
public void write(org.springframework.util.MultiValueMap<String,?> map, @Nullable org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
- 指定者:
write在接口中org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<String,?>>- 覆盖:
write在类中org.springframework.http.converter.FormHttpMessageConverter- 抛出:
IOExceptionorg.springframework.http.converter.HttpMessageNotWritableException
-
isMultipart
private boolean isMultipart(org.springframework.util.MultiValueMap<String,?> map, @Nullable org.springframework.http.MediaType contentType)
Is multipart boolean.- 参数:
map- the mapcontentType- the content type- 返回:
- the boolean
-
writeForm
private void writeForm(org.springframework.util.MultiValueMap<String,Object> formData, @Nullable org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage) throws IOException
Write form.- 参数:
formData- the form datacontentType- the content typeoutputMessage- the output message- 抛出:
IOException- the io exception
-
getMediaType
private org.springframework.http.MediaType getMediaType(@Nullable org.springframework.http.MediaType mediaType)Gets media type.- 参数:
mediaType- the media type- 返回:
- the media type
-
writeMultipart
private void writeMultipart(org.springframework.util.MultiValueMap<String,Object> parts, org.springframework.http.HttpOutputMessage outputMessage) throws IOException
Write multipart.- 参数:
parts- the partsoutputMessage- the output message- 抛出:
IOException- the io exception
-
writeParts
private void writeParts(OutputStream os, org.springframework.util.MultiValueMap<String,Object> parts, byte[] boundary) throws IOException
Write parts.- 参数:
os- the osparts- the partsboundary- the boundary- 抛出:
IOException- the io exception
-
writePart
private void writePart(String name, org.springframework.http.HttpEntity<?> partEntity, OutputStream os) throws IOException
Write part.- 参数:
name- the namepartEntity- the part entityos- the os- 抛出:
IOException- the io exception
-
writeBoundary
private void writeBoundary(OutputStream os, byte[] boundary) throws IOException
Write boundary.- 参数:
os- the osboundary- the boundary- 抛出:
IOException- the io exception
-
writeEnd
private static void writeEnd(OutputStream os, byte[] boundary) throws IOException
Write end.- 参数:
os- the osboundary- the boundary- 抛出:
IOException- the io exception
-
writeNewLine
private static void writeNewLine(OutputStream os) throws IOException
Write new line.- 参数:
os- the os- 抛出:
IOException- the io exception
-
-