示例#1
0
 protected void dump(StringBuilder sb) {
   sb.append("{\"tag\":\"" + header.getFourcc() + "\",");
   List<String> fields = new ArrayList<String>(0);
   collectModel(this.getClass(), fields);
   ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0]));
   sb.append("}");
 }
示例#2
0
  protected void collectModel(Class claz, List<String> model) {
    if (Box.class == claz || !Box.class.isAssignableFrom(claz)) return;

    collectModel(claz.getSuperclass(), model);

    try {
      Method method = claz.getDeclaredMethod(GET_MODEL_FIELDS, List.class);
      method.invoke(this, model);
    } catch (NoSuchMethodException e) {
      checkWrongSignature(claz);
      model.addAll(ToJSON.allFields(claz));
    } catch (Exception e) {
    }
  }