Class SimpleValueReader


  • public class SimpleValueReader
    extends ValueReader
    Default ValueReader used for simple scalar types and related, not including POJO-, Map and Collection types.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int _typeId  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleValueReader​(java.lang.Class<?> raw, int typeId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long _fetchLong​(com.fasterxml.jackson.core.JsonParser p)  
      protected byte[] _readBinary​(com.fasterxml.jackson.core.JsonParser p)  
      protected int[] _readIntArray​(com.fasterxml.jackson.core.JsonParser p)  
      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.
      • Methods inherited from class java.lang.Object

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

      • _typeId

        protected final int _typeId
    • Constructor Detail

      • SimpleValueReader

        public SimpleValueReader​(java.lang.Class<?> raw,
                                 int typeId)
    • Method Detail

      • readNext

        public java.lang.Object readNext​(JSONReader reader,
                                         com.fasterxml.jackson.core.JsonParser p)
                                  throws java.io.IOException
        Description copied from class: ValueReader
        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 ValueReader.read(JSONReader, JsonParser), but some implementations may decide to implement this differently to use (slightly) more efficient accessor in JsonParser, like JsonParser.nextIntValue(int).

        Overrides:
        readNext in class ValueReader
        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
      • read

        public java.lang.Object read​(JSONReader reader,
                                     com.fasterxml.jackson.core.JsonParser p)
                              throws java.io.IOException
        Description copied from class: ValueReader
        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.
        Specified by:
        read in class ValueReader
        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
      • _readBinary

        protected byte[] _readBinary​(com.fasterxml.jackson.core.JsonParser p)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • _readIntArray

        protected int[] _readIntArray​(com.fasterxml.jackson.core.JsonParser p)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • _fetchLong

        protected long _fetchLong​(com.fasterxml.jackson.core.JsonParser p)
                           throws java.io.IOException
        Throws:
        java.io.IOException