6767 // and find values by, for example, using a {@link com.fasterxml.jackson.core.JsonPointer} expression:
6868 int age = root.at("/personal/age").getValueAsInt();
6969</pre>
70- *<p>
71- * The main conversion API is defined in {@link ObjectCodec}, so that
72- * implementation details of this class need not be exposed to
73- * streaming parser and generator classes. Usage via {@link ObjectCodec} is,
74- * however, usually only for cases where dependency to {@link ObjectMapper} is
75- * either not possible (from Streaming API), or undesireable (when only relying
76- * on Streaming API).
7770 *<p>
7871 * Mapper instances are fully thread-safe provided that ALL configuration of the
7972 * instance occurs before ANY read or write calls. If configuration of a mapper instance
116109 * (using {@link #setDefaultTyping}).
117110 */
118111public class ObjectMapper
119- extends ObjectCodec
120112 implements Versioned ,
121113 java .io .Serializable
122114{
@@ -490,7 +482,6 @@ public ObjectMapper(TokenStreamFactory jf) {
490482 protected ObjectMapper (ObjectMapper src )
491483 {
492484 _jsonFactory = src ._jsonFactory .copy ();
493- _jsonFactory .setCodec (this );
494485 _subtypeResolver = src ._subtypeResolver ;
495486 _typeFactory = src ._typeFactory ;
496487 _injectableValues = src ._injectableValues ;
@@ -535,14 +526,9 @@ public ObjectMapper(TokenStreamFactory jf,
535526 // 06-OCt-2017, tatu: Should probably change dependency one of these days...
536527 // but not today.
537528 if (jf == null ) {
538- _jsonFactory = new JsonFactory ();
539- _jsonFactory .setCodec (this );
540- } else {
541- _jsonFactory = jf ;
542- if (jf .getCodec () == null ) { // as per [JACKSON-741]
543- _jsonFactory .setCodec (this );
544- }
529+ jf = new JsonFactory ();
545530 }
531+ _jsonFactory = jf ;
546532 _subtypeResolver = new StdSubtypeResolver ();
547533 RootNameLookup rootNames = new RootNameLookup ();
548534 // and default type factory is shared one
@@ -732,9 +718,9 @@ public Version getMapperVersion() {
732718
733719 @ SuppressWarnings ("unchecked" )
734720 @ Override
735- public < C extends ObjectCodec > C getOwner () {
721+ public Object getOwner () {
736722 // why do we need the cast here?!?
737- return ( C ) ObjectMapper .this ;
723+ return ObjectMapper .this ;
738724 }
739725
740726 @ Override
@@ -1733,7 +1719,6 @@ public ObjectMapper setConfig(SerializationConfig config) {
17331719 * @return {@link TokenStreamFactory} that this mapper uses when it needs to
17341720 * construct Json parser and generators
17351721 */
1736- @ Override
17371722 public TokenStreamFactory getFactory () { return _jsonFactory ; }
17381723
17391724 /**
@@ -1753,9 +1738,6 @@ public ObjectMapper setDateFormat(DateFormat dateFormat)
17531738 return this ;
17541739 }
17551740
1756- /**
1757- * @since 2.5
1758- */
17591741 public DateFormat getDateFormat () {
17601742 // arbitrary choice but let's do:
17611743 return _serializationConfig .getDateFormat ();
@@ -2152,7 +2134,6 @@ public boolean isEnabled(JsonFactory.Feature f) {
21522134 * @throws JsonMappingException if the input JSON structure does not match structure
21532135 * expected for result type (or has other mismatch issues)
21542136 */
2155- @ Override
21562137 @ SuppressWarnings ("unchecked" )
21572138 public <T > T readValue (JsonParser p , Class <T > valueType )
21582139 throws IOException , JsonParseException , JsonMappingException
@@ -2177,7 +2158,6 @@ public <T> T readValue(JsonParser p, Class<T> valueType)
21772158 * @throws JsonMappingException if the input JSON structure does not match structure
21782159 * expected for result type (or has other mismatch issues)
21792160 */
2180- @ Override
21812161 @ SuppressWarnings ("unchecked" )
21822162 public <T > T readValue (JsonParser p , TypeReference <?> valueTypeRef )
21832163 throws IOException , JsonParseException , JsonMappingException
@@ -2201,7 +2181,6 @@ public <T> T readValue(JsonParser p, TypeReference<?> valueTypeRef)
22012181 * @throws JsonMappingException if the input JSON structure does not match structure
22022182 * expected for result type (or has other mismatch issues)
22032183 */
2204- @ Override
22052184 @ SuppressWarnings ("unchecked" )
22062185 public final <T > T readValue (JsonParser p , ResolvedType valueType )
22072186 throws IOException , JsonParseException , JsonMappingException
@@ -2250,7 +2229,6 @@ public <T> T readValue(JsonParser p, JavaType valueType)
22502229 * @throws JsonParseException if underlying input contains invalid content
22512230 * of type {@link JsonParser} supports (JSON for default case)
22522231 */
2253- @ Override
22542232 public <T extends TreeNode > T readTree (JsonParser p )
22552233 throws IOException , JsonProcessingException
22562234 {
@@ -2296,21 +2274,6 @@ public <T extends TreeNode> T readTree(JsonParser p)
22962274 *<p>
22972275 * Note that {@link ObjectReader} has more complete set of variants.
22982276 */
2299- @ Override
2300- public <T > MappingIterator <T > readValues (JsonParser p , ResolvedType valueType )
2301- throws IOException , JsonProcessingException
2302- {
2303- return readValues (p , (JavaType ) valueType );
2304- }
2305-
2306- /**
2307- * Convenience method, equivalent in function to:
2308- *<pre>
2309- * readerFor(valueType).readValues(p);
2310- *</pre>
2311- *<p>
2312- * Type-safe overload of {@link #readValues(JsonParser, ResolvedType)}.
2313- */
23142277 public <T > MappingIterator <T > readValues (JsonParser p , JavaType valueType )
23152278 throws IOException , JsonProcessingException
23162279 {
@@ -2327,25 +2290,14 @@ public <T> MappingIterator<T> readValues(JsonParser p, JavaType valueType)
23272290 * readerFor(valueType).readValues(p);
23282291 *</pre>
23292292 *<p>
2330- * Type-safe overload of {@link #readValues(JsonParser, ResolvedType )}.
2293+ * Type-safe overload of {@link #readValues(JsonParser, JavaType )}.
23312294 */
2332- @ Override
23332295 public <T > MappingIterator <T > readValues (JsonParser p , Class <T > valueType )
23342296 throws IOException , JsonProcessingException
23352297 {
23362298 return readValues (p , _typeFactory .constructType (valueType ));
23372299 }
23382300
2339- /**
2340- * Method for reading sequence of Objects from parser stream.
2341- */
2342- @ Override
2343- public <T > MappingIterator <T > readValues (JsonParser p , TypeReference <?> valueTypeRef )
2344- throws IOException , JsonProcessingException
2345- {
2346- return readValues (p , _typeFactory .constructType (valueTypeRef ));
2347- }
2348-
23492301 /*
23502302 /**********************************************************
23512303 /* Public API not included in ObjectCodec: deserialization
@@ -2550,11 +2502,10 @@ public void writeValue(JsonGenerator g, Object value)
25502502
25512503 /*
25522504 /**********************************************************
2553- /* Public API (from TreeCodec via ObjectCodec) : Tree Model support
2505+ /* Public API: Tree Model support
25542506 /**********************************************************
25552507 */
25562508
2557- @ Override
25582509 public void writeTree (JsonGenerator g , TreeNode rootNode )
25592510 throws IOException , JsonProcessingException
25602511 {
@@ -2586,7 +2537,6 @@ public void writeTree(JsonGenerator g, JsonNode rootNode)
25862537 * part of core package, whereas impls are part of mapper
25872538 * package)
25882539 */
2589- @ Override
25902540 public ObjectNode createObjectNode () {
25912541 return _deserializationConfig .getNodeFactory ().objectNode ();
25922542 }
@@ -2598,7 +2548,6 @@ public ObjectNode createObjectNode() {
25982548 * part of core package, whereas impls are part of mapper
25992549 * package)
26002550 */
2601- @ Override
26022551 public ArrayNode createArrayNode () {
26032552 return _deserializationConfig .getNodeFactory ().arrayNode ();
26042553 }
@@ -2609,7 +2558,6 @@ public ArrayNode createArrayNode() {
26092558 *
26102559 * @param n Root node of the tree that resulting parser will read from
26112560 */
2612- @ Override
26132561 public JsonParser treeAsTokens (TreeNode n ) {
26142562 DeserializationContext ctxt = createDeserializationContext ();
26152563 return new TreeTraversingParser ((JsonNode ) n , ctxt );
@@ -2625,7 +2573,6 @@ public JsonParser treeAsTokens(TreeNode n) {
26252573 *</pre>
26262574 */
26272575 @ SuppressWarnings ("unchecked" )
2628- @ Override
26292576 public <T > T treeToValue (TreeNode n , Class <T > valueType )
26302577 throws JsonProcessingException
26312578 {
0 commit comments