if (in == null) return "null";
    public String getScalarAsString(Object in) {        Class type = in.getClass();        if (String.class.isAssignableFrom(type)) {            return quote((String) in);        }        else if(Date.class.isAssignableFrom(type)) {            return "new Date(" + ((Date) in).getTime() + ")";        }        else {            return in.toString();        }    }