public void testEmbeddedObjectInObject() throws Exception { TokenBuffer buf = new TokenBuffer(MAPPER); buf.writeStartObject(); buf.writeFieldName("pojo"); buf.writeObject(MARKER); buf.writeEndObject(); JsonNode node = MAPPER.readTree(buf.asParser()); buf.close(); assertTrue(node.isObject()); assertEquals(1, node.size()); JsonNode n = node.get("pojo"); assertTrue(n.isPojo()); assertSame(MARKER, ((POJONode) n).getPojo()); }
private final Object _deserialize( JsonParser paramJsonParser, DeserializationContext paramDeserializationContext) throws IOException { Object localObject1; if (paramJsonParser.canReadTypeId()) { localObject1 = paramJsonParser.getTypeId(); if (localObject1 != null) { paramJsonParser = _deserializeWithNativeTypeId( paramJsonParser, paramDeserializationContext, localObject1); } } do { boolean bool; Object localObject2; do { return paramJsonParser; bool = paramJsonParser.isExpectedStartArrayToken(); String str = _locateTypeId(paramJsonParser, paramDeserializationContext); localObject2 = _findDeserializer(paramDeserializationContext, str); localObject1 = paramJsonParser; if (this._typeIdVisible) { localObject1 = paramJsonParser; if (paramJsonParser.getCurrentToken() == JsonToken.START_OBJECT) { localObject1 = new TokenBuffer(null, false); ((TokenBuffer) localObject1).writeStartObject(); ((TokenBuffer) localObject1).writeFieldName(this._typePropertyName); ((TokenBuffer) localObject1).writeString(str); localObject1 = JsonParserSequence.createFlattened( ((TokenBuffer) localObject1).asParser(paramJsonParser), paramJsonParser); ((JsonParser) localObject1).nextToken(); } } localObject2 = ((JsonDeserializer) localObject2) .deserialize((JsonParser) localObject1, paramDeserializationContext); paramJsonParser = (JsonParser) localObject2; } while (!bool); paramJsonParser = (JsonParser) localObject2; } while (((JsonParser) localObject1).nextToken() == JsonToken.END_ARRAY); throw paramDeserializationContext.wrongTokenException( (JsonParser) localObject1, JsonToken.END_ARRAY, "expected closing END_ARRAY after type information and deserialized value"); }