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(); }
public static String toJson(ClassMate mate) { FieldItem fieldItem = new FieldItem(); fieldItem.cloneClassMate(mate); return toJson(fieldItem); }