if (isScalarType(value)) { if (out.length() > 1) { out.append(", ");
if (isScalarType(value)) { if (out.length() > 1) { out.append(", "); } out.append(property.getName()); out.append(":"); out.append( getScalarAsString(value) );
    void buildObjectNode(String targetName, Object in) throws Exception {        StringBuilder out = new StringBuilder();        out.append("{");        PropertyDescriptor[] props = Introspector.getBeanInfo(in.getClass()).getPropertyDescriptors();        for (PropertyDescriptor property : props) {            try {                Object value = property.getReadMethod().invoke(in);                if (isExcludedType(property.getPropertyType()) || value == null) {                    continue;                }                if (isScalarType(value)) {                    if (out.length() > 1) {                        out.append(", ");                    }                    out.append(property.getName());                    out.append(":");                    out.append( getScalarAsString(value) );                }                else {                    buildNode(targetName + "." + property.getName(), value);                }            }            catch (Exception e) {                log.warn(e, "Could not translate property [", property.getName(), "] of type [",                         property.getPropertyType().getName(), "] due to an exception.");            }        }        // Do something a little extra for enums        if (Enum.class.isAssignableFrom(in.getClass())) {            Enum e = (Enum) in;            if (out.length() > 1) { out.append(", "); }            out.append("ordinal:").append( getScalarAsString(e.ordinal()) );            out.append(", name:").append( getScalarAsString(e.name()) );        }        out.append("}");        this.objectValues.put(targetName, out.toString());    }