Jackson Glossary: ObjectReader

Role

This is a fully thread-safe, configured object that can be used to invoke deserialization (JSON to POJO) functionality that ObjectMapper offers (and in some cases features mapper does not offer).

Compared to ObjectMapper, configuration is done using chainable "fluent"-style configuration calls which will create new ObjectReader instances and never change current instance (instances are immutable). This is what fully guarantees thread-safety, so that instances can be shared as well as used as "blueprints" in cases where alternate configurations are needed.

Usage

   1   ObjectMapper mapper = new ObjectMapper();
   2   // we'll be reading instances of MyBean
   3   ObjectReader reader = mapper.reader(MyBean.class);
   4   // and then do other configuration, if any, and read:
   5   MyBean result = reader.readValue(jsonInput);


Back to Jackson Term Glossary


CategoryJackson

ObjectReader (last edited 2010-12-08 21:10:13 by TatuSaloranta)

Copyright ©2009 FasterXML, LLC