cn.felord.payment.wechat.v3

## 类 ExtensionFormHttpMessageConverter

- java.lang.Object
- - org.springframework.http.converter.FormHttpMessageConverter
  - - cn.felord.payment.wechat.v3.ExtensionFormHttpMessageConverter

所有已实现的接口:
  org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<String,?>>

    final class ExtensionFormHttpMessageConverter
    extends org.springframework.http.converter.FormHttpMessageConverter

用于微信支付处理上传的自定义消息转换器.

从以下版本开始:
  1.0.0.RELEASE
作者:
  felord.cn
另请参阅:
  `AllEncompassingFormHttpMessageConverter`

### 嵌套类概要

嵌套类
`private static class` `ExtensionFormHttpMessageConverter.MultipartHttpOutputMessage` The type Multipart http output message.

### 字段概要

字段
`private static String` `BOUNDARY` The constant BOUNDARY.
`private static boolean` `GSON_PRESENT` The constant gsonPresent.
`private static boolean` `JACKSON_2_PRESENT` The constant jackson2Present.
`private static boolean` `JACKSON_2_SMILE_PRESENT` The constant jackson2SmilePresent.
`private static boolean` `JACKSON_2_XML_PRESENT` The constant jackson2XmlPresent.
`private static boolean` `JAXB_2_PRESENT` The constant jaxb2Present.
`private static boolean` `JSONB_PRESENT` The constant jsonbPresent.
`private List<org.springframework.http.converter.HttpMessageConverter<?>>` `partConverters` The Part converters.

### 从类继承的字段 org.springframework.http.converter.FormHttpMessageConverter

`DEFAULT_CHARSET`

### 构造器概要

构造器
构造器和说明
`ExtensionFormHttpMessageConverter()` Instantiates a new Upload http message converter.

### 方法概要

所有方法 静态方法 实例方法 具体方法
`private void` `applyDefaultCharset()` Apply the configured charset as a default to registered part converters.
`private org.springframework.http.MediaType` `getMediaType(org.springframework.http.MediaType mediaType)` Gets media type.
`private boolean` `isMultipart(org.springframework.util.MultiValueMap<String,?> map, org.springframework.http.MediaType contentType)` Is multipart boolean.
`void` `write(org.springframework.util.MultiValueMap<String,?> map, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage)`
`private void` `writeBoundary(OutputStream os, byte[] boundary)` Write boundary.
`private static void` `writeEnd(OutputStream os, byte[] boundary)` Write end.
`private void` `writeForm(org.springframework.util.MultiValueMap<String,Object> formData, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage)` Write form.
`private void` `writeMultipart(org.springframework.util.MultiValueMap<String,Object> parts, org.springframework.http.HttpOutputMessage outputMessage)` Write multipart.
`private static void` `writeNewLine(OutputStream os)` Write new line.
`private void` `writePart(String name, org.springframework.http.HttpEntity<?> partEntity, OutputStream os)` Write part.
`private void` `writeParts(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`

### 从类继承的方法 java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 从接口继承的方法 org.springframework.http.converter.HttpMessageConverter

`getSupportedMediaTypes`

### 字段详细资料

#### BOUNDARY

    private static final String BOUNDARY

The constant BOUNDARY.

另请参阅:
  常量字段值

#### 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.

### 构造器详细资料

#### ExtensionFormHttpMessageConverter

    public ExtensionFormHttpMessageConverter()

Instantiates a new Upload http message converter.

### 方法详细资料

#### 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`
抛出:
  `IOException`
  `org.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 map
  `contentType` - 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 data
  `contentType` - the content type
  `outputMessage` - 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 parts
  `outputMessage` - 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 os
  `parts` - the parts
  `boundary` - 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 name
  `partEntity` - the part entity
  `os` - the os
抛出:
  `IOException` - the io exception

#### writeBoundary

    private void writeBoundary(OutputStream os,
                               byte[] boundary)
                        throws IOException

Write boundary.

参数:
  `os` - the os
  `boundary` - the boundary
抛出:
  `IOException` - the io exception

#### writeEnd

    private static void writeEnd(OutputStream os,
                                 byte[] boundary)
                          throws IOException

Write end.

参数:
  `os` - the os
  `boundary` - 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