Class JsonReader<T>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JsonReader.FieldMapping
      If you're implementing a JsonReader for a JSON object, you can use this to map field names to a number you can switch on to efficiently locate assign a field.
      static class  JsonReader.FileLoadException  
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonReader()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static com.fasterxml.jackson.core.JsonLocation expectArrayEnd​(com.fasterxml.jackson.core.JsonParser parser)  
      static com.fasterxml.jackson.core.JsonLocation expectArrayStart​(com.fasterxml.jackson.core.JsonParser parser)  
      static void expectObjectEnd​(com.fasterxml.jackson.core.JsonParser parser)  
      static com.fasterxml.jackson.core.JsonLocation expectObjectStart​(com.fasterxml.jackson.core.JsonParser parser)  
      static boolean isArrayEnd​(com.fasterxml.jackson.core.JsonParser parser)  
      static boolean isArrayStart​(com.fasterxml.jackson.core.JsonParser parser)  
      static com.fasterxml.jackson.core.JsonToken nextToken​(com.fasterxml.jackson.core.JsonParser parser)
      A wrapper around 'JsonParser.nextToken' that throws our own better JsonReadException instead of Jackson's JsonParseException.
      abstract T read​(com.fasterxml.jackson.core.JsonParser parser)  
      static boolean readBoolean​(com.fasterxml.jackson.core.JsonParser parser)  
      static double readDouble​(com.fasterxml.jackson.core.JsonParser parser)  
      static <T> T readEnum​(com.fasterxml.jackson.core.JsonParser parser, java.util.HashMap<java.lang.String,​T> values, T catch_all)  
      T readField​(com.fasterxml.jackson.core.JsonParser parser, java.lang.String fieldName, java.lang.Object v)  
      T readFields​(com.fasterxml.jackson.core.JsonParser parser)  
      T readFromFile​(java.io.File file)  
      T readFromFile​(java.lang.String filePath)  
      T readFromTags​(java.lang.String[] tags, com.fasterxml.jackson.core.JsonParser parser)  
      T readFully​(byte[] utf8Body)  
      T readFully​(com.fasterxml.jackson.core.JsonParser parser)  
      T readFully​(java.io.InputStream utf8Body)  
      T readFully​(java.lang.String body)  
      T readOptional​(com.fasterxml.jackson.core.JsonParser parser)  
      static java.lang.String[] readTags​(com.fasterxml.jackson.core.JsonParser parser)
      Helper to read and parse the optional ".tag" field.
      static long readUnsignedLong​(com.fasterxml.jackson.core.JsonParser parser)  
      static long readUnsignedLongField​(com.fasterxml.jackson.core.JsonParser parser, java.lang.String fieldName, long v)  
      static void skipValue​(com.fasterxml.jackson.core.JsonParser parser)  
      void validate​(T value)  
      • Methods inherited from class java.lang.Object

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

      • UnsignedLongReader

        public static final JsonReader<java.lang.Long> UnsignedLongReader
      • Int64Reader

        public static final JsonReader<java.lang.Long> Int64Reader
      • Int32Reader

        public static final JsonReader<java.lang.Integer> Int32Reader
      • UInt64Reader

        public static final JsonReader<java.lang.Long> UInt64Reader
      • UInt32Reader

        public static final JsonReader<java.lang.Long> UInt32Reader
      • Float64Reader

        public static final JsonReader<java.lang.Double> Float64Reader
      • Float32Reader

        public static final JsonReader<java.lang.Float> Float32Reader
      • StringReader

        public static final JsonReader<java.lang.String> StringReader
      • BinaryReader

        public static final JsonReader<byte[]> BinaryReader
      • BooleanReader

        public static final JsonReader<java.lang.Boolean> BooleanReader
      • VoidReader

        public static final JsonReader<java.lang.Object> VoidReader
    • Constructor Detail

      • JsonReader

        public JsonReader()
    • Method Detail

      • readFromTags

        public T readFromTags​(java.lang.String[] tags,
                              com.fasterxml.jackson.core.JsonParser parser)
                       throws java.io.IOException,
                              JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readFields

        public T readFields​(com.fasterxml.jackson.core.JsonParser parser)
                     throws java.io.IOException,
                            JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • validate

        public void validate​(T value)
      • readField

        public final T readField​(com.fasterxml.jackson.core.JsonParser parser,
                                 java.lang.String fieldName,
                                 java.lang.Object v)
                          throws java.io.IOException,
                                 JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readOptional

        public final T readOptional​(com.fasterxml.jackson.core.JsonParser parser)
                             throws java.io.IOException,
                                    JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readTags

        public static java.lang.String[] readTags​(com.fasterxml.jackson.core.JsonParser parser)
                                           throws java.io.IOException,
                                                  JsonReadException
        Helper to read and parse the optional ".tag" field. If one is found, positions the parser at the next field (or the closing brace); otherwise leaves the parser position unchanged. Returns null if there isn't a ".tag" field; otherwise an array of strings (the tags). Initially the parser must be positioned right after the opening brace.
        Throws:
        java.io.IOException
        JsonReadException
      • expectObjectStart

        public static com.fasterxml.jackson.core.JsonLocation expectObjectStart​(com.fasterxml.jackson.core.JsonParser parser)
                                                                         throws java.io.IOException,
                                                                                JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • expectObjectEnd

        public static void expectObjectEnd​(com.fasterxml.jackson.core.JsonParser parser)
                                    throws java.io.IOException,
                                           JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • expectArrayStart

        public static com.fasterxml.jackson.core.JsonLocation expectArrayStart​(com.fasterxml.jackson.core.JsonParser parser)
                                                                        throws java.io.IOException,
                                                                               JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • expectArrayEnd

        public static com.fasterxml.jackson.core.JsonLocation expectArrayEnd​(com.fasterxml.jackson.core.JsonParser parser)
                                                                      throws java.io.IOException,
                                                                             JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • isArrayEnd

        public static boolean isArrayEnd​(com.fasterxml.jackson.core.JsonParser parser)
      • isArrayStart

        public static boolean isArrayStart​(com.fasterxml.jackson.core.JsonParser parser)
      • skipValue

        public static void skipValue​(com.fasterxml.jackson.core.JsonParser parser)
                              throws java.io.IOException,
                                     JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readUnsignedLong

        public static long readUnsignedLong​(com.fasterxml.jackson.core.JsonParser parser)
                                     throws java.io.IOException,
                                            JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readUnsignedLongField

        public static long readUnsignedLongField​(com.fasterxml.jackson.core.JsonParser parser,
                                                 java.lang.String fieldName,
                                                 long v)
                                          throws java.io.IOException,
                                                 JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readBoolean

        public static boolean readBoolean​(com.fasterxml.jackson.core.JsonParser parser)
                                   throws java.io.IOException,
                                          JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readDouble

        public static double readDouble​(com.fasterxml.jackson.core.JsonParser parser)
                                 throws java.io.IOException,
                                        JsonReadException
        Throws:
        java.io.IOException
        JsonReadException
      • readEnum

        public static <T> T readEnum​(com.fasterxml.jackson.core.JsonParser parser,
                                     java.util.HashMap<java.lang.String,​T> values,
                                     T catch_all)
                              throws java.io.IOException,
                                     JsonReadException
        Throws:
        java.io.IOException
        JsonReadException