Class BeanReader

java.lang.Object
com.fasterxml.jackson.jr.ob.api.ValueReader
com.fasterxml.jackson.jr.ob.impl.BeanReader

public class BeanReader extends ValueReader
Class that contains information about dynamically introspected Bean types, to be able to deserialize (read) JSON into a POJO and serialize (write) POJO as JSON.
  • Field Details

    • _propsByName

      protected final Map<String,BeanPropertyReader> _propsByName
    • _aliasMapping

      protected final Map<String,String> _aliasMapping
      Mapping of aliased names to primary names (direct linkage unfortunately impractical due to implementation limits).
      Since:
      2.11
    • _ignorableNames

      protected final Set<String> _ignorableNames
    • _constructors

      protected final BeanConstructors _constructors
      Since:
      2.17
    • _isRecordType

      protected final boolean _isRecordType
    • _recordNullValues

      protected final Object[] _recordNullValues
      Array that contains default null values for POJO/Record properties; needed for primitive types for which null is not a valid value.
      Since:
      2.21
  • Constructor Details

  • Method Details

    • propertiesByName

      public Map<String,BeanPropertyReader> propertiesByName()
    • findProperty

      public BeanPropertyReader findProperty(String name)
    • readNext

      public Object readNext(JSONReader r, com.fasterxml.jackson.core.JsonParser p) throws 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 accessors in JsonParser, like JsonParser.nextIntValue(int).

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

      public Object read(JSONReader r, com.fasterxml.jackson.core.JsonParser p) throws IOException
      Method used for deserialization; will read an instance of the bean type using given parser.
      Specified by:
      read in class ValueReader
      Parameters:
      r - 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:
      IOException
    • handleUnknown

      protected void handleUnknown(JSONReader reader, com.fasterxml.jackson.core.JsonParser parser, String fieldName) throws IOException
      Throws:
      IOException
    • _reportProblem

      protected IOException _reportProblem(com.fasterxml.jackson.core.JsonParser p)