本文整理汇总了Java中com.github.javaparser.ast.stmt.DoStmt类的典型用法代码示例。如果您正苦于以下问题:Java DoStmt类的具体用法?Java DoStmt怎么用?Java DoStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoStmt类属于com.github.javaparser.ast.stmt包,在下文中一共展示了DoStmt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public Node visit(final DoStmt n, final A arg) {
visitComment(n, arg);
final Statement body = (Statement) n.getBody().accept(this, arg);
if (body == null) {
return null;
}
n.setBody(body);
final Expression condition = (Expression) n.getCondition().accept(this, arg);
if (condition == null) {
return null;
}
n.setCondition(condition);
return n;
}
示例2: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public void visit(final DoStmt n, final Void arg) {
if (canAddNewLine(n)) printer.println();
printJavaComment(n.getComment(), arg);
printer.print("do ");
n.getBody().accept(this, arg);
printer.print(" while (");
n.getCondition().accept(this, arg);
printer.print(");");
if (getNext(n) != null) printer.println();
}
示例3: isBlockStmt
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
private static boolean isBlockStmt(Node n) {
return n instanceof BlockStmt
|| n instanceof DoStmt
|| n instanceof ForStmt
|| n instanceof ForeachStmt
|| n instanceof IfStmt
|| n instanceof SwitchStmt
|| n instanceof TryStmt
|| n instanceof WhileStmt;
}
示例4: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public void visit(final DoStmt n, final Object arg) {
printer.printLn("DoStmt");
printJavaComment(n.getComment(), arg);
printer.print("do ");
n.getBody().accept(this, arg);
printer.print(" while (");
n.getCondition().accept(this, arg);
printer.print(");");
}
示例5: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public JCTree visit(final DoStmt n, final Object arg) {
//ARG0: JCStatement body
JCStatement arg0 = (JCStatement) n.getBody().accept(this, arg);
//ARG1: JCExpression cond
JCExpression arg1 = (JCExpression) n.getCondition().accept(this, arg);
return new AJCDoWhileLoop(make.DoLoop(arg0, arg1), ((n.getComment() != null) ? n.getComment().getContent() : null));
}
示例6: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public Boolean visit(final DoStmt n1, final Node arg) {
final DoStmt n2 = (DoStmt) arg;
if (!nodeEquals(n1.getBody(), n2.getBody())) {
return Boolean.FALSE;
}
if (!nodeEquals(n1.getCondition(), n2.getCondition())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
示例7: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public void visit(final DoStmt n, final Object arg) {
printJavaComment(n.getComment(), arg);
printer.print("do ");
n.getBody().accept(this, arg);
printer.print(" while (");
n.getCondition().accept(this, arg);
printer.print(");");
}
示例8: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public Boolean visit(final DoStmt n1, final Node arg) {
final DoStmt n2 = (DoStmt) arg;
if (!nodeEquals(n1.getBody(), n2.getBody())) {
return false;
}
if (!nodeEquals(n1.getCondition(), n2.getCondition())) {
return false;
}
return true;
}
示例9: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public Node visit(DoStmt _n, Object _arg) {
Statement body = cloneNodes(_n.getBody(), _arg);
Expression condition = cloneNodes(_n.getCondition(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
DoStmt r = new DoStmt(
_n.getRange(),
body, condition
);
r.setComment(comment);
return r;
}
示例10: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public void visit(final DoStmt n, final Object arg) {
printJavaComment(n.getComment(), arg);
printer.print("do ");
n.getBody().accept(this, arg);
printer.print(" while (");
n.getCondition().accept(this, arg);
printer.print(");");
}
示例11: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public Node visit(
DoStmt n, Map<Node, Node> arg
) {
if (arg.containsKey(n)) {
return arg.get(n);
}
return super.visit(n, arg);
}
示例12: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override
public void visit(DoStmt n, Script arg) {
}
示例13: doMerge
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public DoStmt doMerge(DoStmt first, DoStmt second) {
DoStmt ds = new DoStmt();
ds.setBody(mergeSingle(first.getBody(),second.getBody()));
ds.setCondition(mergeSingle(first.getCondition(),second.getCondition()));
return ds;
}
示例14: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public void visit(final DoStmt n, final A arg) {
visitComment(n.getComment(), arg);
n.getBody().accept(this, arg);
n.getCondition().accept(this, arg);
}
示例15: visit
import com.github.javaparser.ast.stmt.DoStmt; //导入依赖的package包/类
@Override public void visit(final DoStmt n, final A arg) {
jw.write(n);
visitComment(n.getComment(), arg);
n.getBody().accept(this, arg);
n.getCondition().accept(this, arg);
}