예제 #1
0
  private static String getListDemoValue(FieldItem fieldItem, List<String> myPaths) {
    int level = myPaths.size();
    StringBuilder sb = new StringBuilder();
    sb.append("[");
    sb.append(getCommentText(fieldItem));
    sb.append(DocletConstant.TURN_LINE);

    List<ClassMate> typeArguments = fieldItem.getTypeArguments();
    ClassMate mate = typeArguments.get(0);
    FieldItem item = new FieldItem();
    item.cloneClassMate(mate);
    sb.append(JsonFormater.toJson(item, myPaths));

    sb.append(DocletConstant.TURN_LINE);
    sb.append(StringHelper.loopTab(level));
    sb.append("]");

    if (!fieldItem.isLastOne()) {
      sb.append(",");
    }
    return sb.toString();
  }
예제 #2
0
 public static String toJson(ClassMate mate) {
   FieldItem fieldItem = new FieldItem();
   fieldItem.cloneClassMate(mate);
   return toJson(fieldItem);
 }