@Override public void scan(CtElement element) { hashCode += 1; super.scan(element); }
/** * Generically scans a collection of meta-model elements. */ public void scan(Collection<? extends CtElement> elements) { if (elements != null) { for (CtElement e : elements) { scan(e); } } }
insertionVisitor.scan(commentParent);
/** * Generically scans a collection of meta-model elements. */ public void scan(Collection<? extends CtElement> elements) { if (elements != null) { for (CtElement e : elements) { scan(e); } } }
@Override public void scan(CtElement e) { if (e == null) { return; } // Do not visit the AST, only the first element if (!isScanned) { isScanned = true; SourcePosition sp = e.getPosition(); if (sp.getSourceStart() == comment.getPosition().getSourceStart()) { e.addComment(comment); return; } if (sp instanceof DeclarationSourcePosition) { DeclarationSourcePosition dsp = (DeclarationSourcePosition) sp; if (comment.getPosition().getSourceEnd() < dsp.getModifierSourceEnd()) { e.addComment(comment); return; } } super.scan(e); } }