Class ValueReader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<?> _valueType
      Type of values this reader will read
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ValueReader​(java.lang.Class<?> valueType)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String _tokenDesc​(com.fasterxml.jackson.core.JsonParser p)
      Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.
      static java.lang.String _tokenDesc​(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.JsonToken t)
      Helper method for getting description of given token for use in descriptions and exception messages.
      abstract java.lang.Object read​(JSONReader reader, com.fasterxml.jackson.core.JsonParser p)
      Method called to deserialize value of type supported by this reader, using given parser.
      java.lang.Object readNext​(JSONReader reader, com.fasterxml.jackson.core.JsonParser p)
      Method called to deserialize value of type supported by this reader, using given parser.
      java.lang.Class<?> valueType()
      Accessor for non-generic (type-erased) type of values this reader produces from input.
      • Methods inherited from class java.lang.Object

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

      • _valueType

        protected final java.lang.Class<?> _valueType
        Type of values this reader will read
        Since:
        2.10
    • Constructor Detail

      • ValueReader

        protected ValueReader​(java.lang.Class<?> valueType)
    • Method Detail

      • read

        public abstract java.lang.Object read​(JSONReader reader,
                                              com.fasterxml.jackson.core.JsonParser p)
                                       throws java.io.IOException
        Method called to deserialize value of type supported by this reader, using given parser. Parser is already positioned to the (first) token of the value to read.
        Parameters:
        reader - Context object that allows calling other read methods for contained values of different types (for example for collection readers).
        p - Underlying parser used for reading decoded token stream
        Throws:
        java.io.IOException
      • readNext

        public java.lang.Object readNext​(JSONReader reader,
                                         com.fasterxml.jackson.core.JsonParser p)
                                  throws java.io.IOException
        Method called to deserialize value of type supported by this reader, using given parser. Parser is not yet positioned to the (first) token of the value to read and needs to be advanced.

        Default implementation simply calls `p.nextToken()` first, then calls {#link read(JSONReader, JsonParser), but some implementations may decide to implement this differently to use (slightly) more efficient accessor in JsonParser, like JsonParser.nextIntValue(int).

        Parameters:
        reader - Context object that allows calling other read methods for contained values of different types (for example for collection readers).
        p - Underlying parser used for reading decoded token stream
        Throws:
        java.io.IOException
      • valueType

        public java.lang.Class<?> valueType()
        Accessor for non-generic (type-erased) type of values this reader produces from input.
        Since:
        2.10
      • _tokenDesc

        public static java.lang.String _tokenDesc​(com.fasterxml.jackson.core.JsonParser p)
                                           throws java.io.IOException
        Helper method for getting description of the token parser currently points to, for use in descriptions and exception messages.
        Throws:
        java.io.IOException
      • _tokenDesc

        public static java.lang.String _tokenDesc​(com.fasterxml.jackson.core.JsonParser p,
                                                  com.fasterxml.jackson.core.JsonToken t)
                                           throws java.io.IOException
        Helper method for getting description of given token for use in descriptions and exception messages.
        Throws:
        java.io.IOException