use of com.github.javaparser.ast.visitor.Visitable in project Matcher by sfPlayer1.
the class HtmlPrinter method printPrePostFixRequiredList.
private void printPrePostFixRequiredList(final NodeList<? extends Visitable> args, final Void arg, String prefix, String separator, String postfix) {
printer.print(prefix);
if (!args.isEmpty()) {
for (final Iterator<? extends Visitable> i = args.iterator(); i.hasNext(); ) {
final Visitable v = i.next();
v.accept(this, arg);
if (i.hasNext()) {
printer.print(separator);
}
}
}
printer.print(postfix);
}
use of com.github.javaparser.ast.visitor.Visitable in project gin by gintool.
the class CloneVisitorCopyIDs method visit.
@Override
public Visitable visit(final ClassExpr n, final Object arg) {
Visitable r = checkForReplacement(n);
if (r == null) {
r = super.visit(n, arg);
((ClassExpr) r).setData(SourceFileTree.NODEKEY_ID, n.containsData(SourceFileTree.NODEKEY_ID) ? n.getData(SourceFileTree.NODEKEY_ID) : SourceFileTree.NODE_NULL_ID);
}
return r;
}
use of com.github.javaparser.ast.visitor.Visitable in project gin by gintool.
the class CloneVisitorCopyIDs method visit.
@Override
public Visitable visit(final UnknownType n, final Object arg) {
Visitable r = checkForReplacement(n);
if (r == null) {
r = super.visit(n, arg);
((UnknownType) r).setData(SourceFileTree.NODEKEY_ID, n.containsData(SourceFileTree.NODEKEY_ID) ? n.getData(SourceFileTree.NODEKEY_ID) : SourceFileTree.NODE_NULL_ID);
}
return r;
}
use of com.github.javaparser.ast.visitor.Visitable in project gin by gintool.
the class CloneVisitorCopyIDs method visit.
@Override
public Visitable visit(final MemberValuePair n, final Object arg) {
Visitable r = checkForReplacement(n);
if (r == null) {
r = super.visit(n, arg);
((MemberValuePair) r).setData(SourceFileTree.NODEKEY_ID, n.containsData(SourceFileTree.NODEKEY_ID) ? n.getData(SourceFileTree.NODEKEY_ID) : SourceFileTree.NODE_NULL_ID);
}
return r;
}
use of com.github.javaparser.ast.visitor.Visitable in project gin by gintool.
the class CloneVisitorCopyIDs method visit.
@Override
public Visitable visit(final ArrayInitializerExpr n, final Object arg) {
Visitable r = checkForReplacement(n);
if (r == null) {
r = super.visit(n, arg);
((ArrayInitializerExpr) r).setData(SourceFileTree.NODEKEY_ID, n.containsData(SourceFileTree.NODEKEY_ID) ? n.getData(SourceFileTree.NODEKEY_ID) : SourceFileTree.NODE_NULL_ID);
}
return r;
}
Aggregations