Jackson Glossary: ObjectMapper

Role

This is the central factory object for data binding functionality and is usually the first object application code creates and interacts with.

Instances are fully thread-safe when "configure-then-use" pattern is used (i.e. configuration is not thread-safe but usage is). And when using ObjectWriter and ObjectReader instances even configuration is thread safe.

Usage

   1   ObjectMapper mapper = new ObjectMapper();
   2   mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
   3   String json = mapper.writeValueAsString(new MyBean());

Known sub-classes


Back to Jackson Term Glossary


CategoryJackson

ObjectMapper (last edited 2010-12-20 18:40:02 by TatuSaloranta)

Copyright ©2009 FasterXML, LLC