Class TextCodec

  • All Implemented Interfaces:
    HttpDecoder<java.lang.Object,​java.lang.String>, HttpEncoder<java.lang.Object,​java.lang.CharSequence>

    public class TextCodec
    extends java.lang.Object
    implements HttpEncoder<java.lang.Object,​java.lang.CharSequence>, HttpDecoder<java.lang.Object,​java.lang.String>
    Simple string codecs.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType)  
      TextCodec​(ch.raffael.meldioc.library.codec.ContentType inputContentType, ch.raffael.meldioc.library.codec.ContentType outputContentType)  
      TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType, java.nio.charset.Charset charset)  
      TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType, java.nio.charset.Charset inCharset, java.nio.charset.Charset outCharset)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void decode​(io.undertow.server.HttpServerExchange exchange, java.lang.Object ctx, HttpDecoder.Consumer<? super java.lang.Object,​? super java.lang.String> consumer)  
      void encode​(io.undertow.server.HttpServerExchange exchange, java.lang.Object ctx, java.lang.CharSequence value)  
      static TextCodec html()  
      static TextCodec html​(java.nio.charset.Charset charset)  
      static TextCodec html​(java.nio.charset.Charset inCharset, java.nio.charset.Charset outCharset)  
      static TextCodec json()  
      static TextCodec plainText()  
      static TextCodec plainText​(java.nio.charset.Charset charset)  
      static TextCodec plainText​(java.nio.charset.Charset inCharset, java.nio.charset.Charset outCharset)  
      static TextCodec xhtml()  
      static TextCodec xhtml​(java.nio.charset.Charset charset)  
      static TextCodec xhtml​(java.nio.charset.Charset inCharset, java.nio.charset.Charset outCharset)  
      static TextCodec xml()  
      static TextCodec xml​(java.nio.charset.Charset charset)  
      static TextCodec xml​(java.nio.charset.Charset inCharset, java.nio.charset.Charset outCharset)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextCodec

        public TextCodec​(ch.raffael.meldioc.library.codec.ContentType inputContentType,
                         ch.raffael.meldioc.library.codec.ContentType outputContentType)
      • TextCodec

        public TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType)
      • TextCodec

        public TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType,
                         java.nio.charset.Charset charset)
      • TextCodec

        public TextCodec​(ch.raffael.meldioc.library.codec.ContentType contentType,
                         java.nio.charset.Charset inCharset,
                         java.nio.charset.Charset outCharset)
    • Method Detail

      • plainText

        public static TextCodec plainText()
      • plainText

        public static TextCodec plainText​(java.nio.charset.Charset charset)
      • plainText

        public static TextCodec plainText​(java.nio.charset.Charset inCharset,
                                          java.nio.charset.Charset outCharset)
      • html

        public static TextCodec html​(java.nio.charset.Charset charset)
      • html

        public static TextCodec html​(java.nio.charset.Charset inCharset,
                                     java.nio.charset.Charset outCharset)
      • xml

        public static TextCodec xml​(java.nio.charset.Charset charset)
      • xml

        public static TextCodec xml​(java.nio.charset.Charset inCharset,
                                    java.nio.charset.Charset outCharset)
      • xhtml

        public static TextCodec xhtml​(java.nio.charset.Charset charset)
      • xhtml

        public static TextCodec xhtml​(java.nio.charset.Charset inCharset,
                                      java.nio.charset.Charset outCharset)
      • encode

        public void encode​(io.undertow.server.HttpServerExchange exchange,
                           java.lang.Object ctx,
                           java.lang.CharSequence value)
        Specified by:
        encode in interface HttpEncoder<java.lang.Object,​java.lang.CharSequence>
      • decode

        public void decode​(io.undertow.server.HttpServerExchange exchange,
                           java.lang.Object ctx,
                           HttpDecoder.Consumer<? super java.lang.Object,​? super java.lang.String> consumer)
        Specified by:
        decode in interface HttpDecoder<java.lang.Object,​java.lang.String>