예제 #1
0
  public GenericObject deepClone() {
    final GenericObject retValue = new GenericObject(parent, name);

    for (WritableObject obj : allWritable) {
      if (obj instanceof GenericObject) {
        GenericObject go = ((GenericObject) obj).deepClone();
        retValue.addChild(go);
      } else if (obj instanceof GenericList) {
        GenericList gl = ((GenericList) obj).clone();
        retValue.addList(gl);
      } else if (obj instanceof ObjectVariable) {
        ObjectVariable ov = ((ObjectVariable) obj).clone();
        retValue.values.add(ov);
        retValue.allWritable.add(ov);
      } else if (obj instanceof InlineComment) {
        Comment com = ((InlineComment) obj).clone();
        retValue.generalComments.add(com);
        retValue.allWritable.add(com);
      }
    }

    if (headComment != null) retValue.setHeadComment(headComment.getComment());
    if (inlineComment != null) retValue.setInlineComment(inlineComment.getComment());

    return retValue;
  }
예제 #2
0
 public void addList(String name, List<String> vals, String headComment, String inlineComment) {
   final GenericList list = new GenericList(name);
   list.addAll(vals);
   list.setHeaderComment(headComment);
   list.setInlineComment(inlineComment);
   addList(list);
 }
예제 #3
0
 public GenericList createList(String name) {
   final GenericList list = new GenericList(name);
   addList(list);
   return list;
 }
예제 #4
0
 public void addList(String name, List<String> vals) {
   final GenericList list = new GenericList(name);
   list.addAll(vals);
   addList(list);
 }