BeanExtractor implements Extractor { @SuppressWarnings("PMD.CompareObjectsWithEquals") public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify) throws AttributeNotFoundException { ValueFaultHandler faultHandler = pConverter.getValueFaultHandler(); String pathPart = pPathParts.isEmpty() ? null : pPathParts.pop(); if (pathPart != null) { Object attributeValue = extractBeanPropertyValue(pValue, pathPart, faultHandler); return pConverter.extractObject(attributeValue, pPathParts, jsonify); } else { if (jsonify) { return exctractJsonifiedValue(pConverter, pValue, pPathParts); } else { return pValue; } } }  Class getType(); @SuppressWarnings("PMD.CompareObjectsWithEquals") Object extractObject(ObjectToJsonConverter pConverter, Object pValue,
                                Stack<String> pPathParts, boolean jsonify); Object setObjectValue(StringToObjectConverter pConverter,Object pInner, String pAttribute, Object pValue); boolean canSetValue();  }
@Test public void simple() throws AttributeNotFoundException { JSONObject res = (JSONObject) extractJson(this); assertEquals(res.get("number"),10); assertEquals(res.get("text"),"Test"); assertFalse((Boolean) res.get("flag")); assertEquals( ((JSONObject) res.get("inner")).get("innerText"),"innerValue"); assertNull(res.get("nulli")); assertTrue(!res.containsKey("forbiddenStream")); assertTrue(res.containsKey("nulli")); assertEquals(res.get("nacked"),"nacked object"); assertEquals(res.get("self"),"[this]"); JSONObject inner = (JSONObject) extractJson(this,"inner"); assertEquals(inner.get("innerText"),"innerValue"); JSONObject innerWithWildcardPath = (JSONObject) extractJson(this,null,"innerDate"); assertEquals(innerWithWildcardPath.size(),1); assertTrue((Long) ((JSONObject) innerWithWildcardPath.get("inner")).get("millis") <= new Date().getTime()); BeanExtractorTest test = (BeanExtractorTest) extractObject(this); assertEquals(test,this); Date date = (Date) extractObject(this,"inner","innerDate"); assertTrue(date.getTime() <= new Date().getTime()); }