Ejemplo n.º 1
0
 public Element importComments(Element e, String... extraComments) {
   if (e != null) {
     importDetails(e, false);
     moveAllCommentsBefore();
   }
   addToCommentBefore(extraComments);
   return this;
 }
Ejemplo n.º 2
0
  public Element importDetails(Element from, boolean move) {
    if (from == null) return this;

    if (!from.getNameSpace().isEmpty()) setNameSpace(from.getNameSpace());

    if (from.getElementFile() != null) setElementFile(from.getElementFile());
    if (from.getElementLine() >= 0) setElementLine(from.getElementLine());
    if (from.getCommentBefore() != null) addToCommentBefore(from.getCommentBefore());
    if (from.getCommentAfter() != null) setCommentAfter(from.getCommentAfter());

    if (move) from.stripDetails();
    return this;
  }
Ejemplo n.º 3
0
 public void addToCommentBefore(String... s) {
   addToCommentBefore(Arrays.asList(s));
 }
Ejemplo n.º 4
0
 public void moveAllCommentsBefore() {
   if (getCommentAfter() != null) {
     addToCommentBefore(getCommentAfter());
     setCommentAfter(null);
   }
 }