类 ExtensionFormHttpMessageConverter

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

    final class ExtensionFormHttpMessageConverter
    extends org.springframework.http.converter.FormHttpMessageConverter
    用于微信支付处理上传的自定义消息转换器.
    作者:
    youta
    另请参阅:
    AllEncompassingFormHttpMessageConverter
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      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
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      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
      • 从接口继承的方法 org.springframework.http.converter.HttpMessageConverter

        getSupportedMediaTypes
    • 字段详细资料

      • 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