Class StringHandler


  • public class StringHandler
    extends Handler
    • Constructor Summary

      Constructors 
      Constructor Description
      StringHandler()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.Object collect​(Decoder isr, char close)
      Gather the input until you find the the closing character making sure that new blocks are are take care of.
      java.lang.Object decode​(Decoder dec)  
      java.lang.Object decode​(Decoder dec, boolean s)  
      java.lang.Object decode​(Decoder dec, java.lang.Number s)  
      java.lang.Object decode​(Decoder dec, java.lang.String s)  
      java.lang.Object decodeArray​(Decoder r)
      An array can be assigned to a string.
      java.lang.Object decodeObject​(Decoder r)
      An object can be assigned to a string.
      void encode​(Encoder app, java.lang.Object object, java.util.Map<java.lang.Object,​java.lang.reflect.Type> visited)  
      (package private) static void string​(java.lang.Appendable app, java.lang.String s)  
      • Methods inherited from class java.lang.Object

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

      • StringHandler

        public StringHandler()
    • Method Detail

      • encode

        public void encode​(Encoder app,
                           java.lang.Object object,
                           java.util.Map<java.lang.Object,​java.lang.reflect.Type> visited)
                    throws java.io.IOException
        Specified by:
        encode in class Handler
        Throws:
        java.io.IOException
      • string

        static void string​(java.lang.Appendable app,
                           java.lang.String s)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • decode

        public java.lang.Object decode​(Decoder dec,
                                       java.lang.String s)
                                throws java.lang.Exception
        Overrides:
        decode in class Handler
        Throws:
        java.lang.Exception
      • decode

        public java.lang.Object decode​(Decoder dec,
                                       java.lang.Number s)
        Overrides:
        decode in class Handler
      • decode

        public java.lang.Object decode​(Decoder dec,
                                       boolean s)
        Overrides:
        decode in class Handler
      • decodeObject

        public java.lang.Object decodeObject​(Decoder r)
                                      throws java.lang.Exception
        An object can be assigned to a string. This means that the stream is interpreted as the object but stored in its complete in the string.
        Overrides:
        decodeObject in class Handler
        Throws:
        java.lang.Exception
      • decodeArray

        public java.lang.Object decodeArray​(Decoder r)
                                     throws java.lang.Exception
        An array can be assigned to a string. This means that the stream is interpreted as the array but stored in its complete in the string.
        Overrides:
        decodeArray in class Handler
        Throws:
        java.lang.Exception
      • collect

        private java.lang.Object collect​(Decoder isr,
                                         char close)
                                  throws java.lang.Exception
        Gather the input until you find the the closing character making sure that new blocks are are take care of.

        This method parses the input for a complete block so that it can be stored in a string. This allows envelopes.

        Throws:
        java.lang.Exception