本文整理汇总了Java中com.github.javaparser.ast.stmt.ReturnStmt.getExpr方法的典型用法代码示例。如果您正苦于以下问题:Java ReturnStmt.getExpr方法的具体用法?Java ReturnStmt.getExpr怎么用?Java ReturnStmt.getExpr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.javaparser.ast.stmt.ReturnStmt
的用法示例。
在下文中一共展示了ReturnStmt.getExpr方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override
public void visit(final ReturnStmt n, final Object arg) {
printer.printLn("ReturnStmt");
printJavaComment(n.getComment(), arg);
printer.print("return");
if (n.getExpr() != null) {
printer.print(" ");
n.getExpr().accept(this, arg);
}
printer.print(";");
}
示例2: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override
public JCTree visit(final ReturnStmt n, final Object arg) {
//ARG0: JCExpression expr
JCExpression arg0 = null;
if (n.getExpr() != null) {
arg0 = (JCExpression) n.getExpr().accept(this, arg);
}
return new AJCReturn(make.Return(arg0), ((n.getComment() != null) ? n.getComment().getContent() : null));
}
示例3: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override
public R visit(final ReturnStmt n, final A arg) {
if (n.getExpr() != null) {
{
R result = n.getExpr().accept(this, arg);
if (result != null) {
return result;
}
}
}
return null;
}
示例4: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public void visit(final ReturnStmt n, final Object arg) {
printJavaComment(n.getComment(), arg);
printer.print("return");
if (n.getExpr() != null) {
printer.print(" ");
n.getExpr().accept(this, arg);
}
printer.print(";");
}
示例5: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public void visit(final ReturnStmt n, final A arg) {
jw.write(n);
visitComment(n.getComment(), arg);
if (n.getExpr() != null) {
n.getExpr().accept(this, arg);
}
}
示例6: thenLambdaInConditionalExpressionInMethodInClassIsParentOfContainedParameter
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Then("ThenExpr in the conditional expression of the statement $statementPosition in method $methodPosition in class $classPosition is LambdaExpr")
public void thenLambdaInConditionalExpressionInMethodInClassIsParentOfContainedParameter(int statementPosition, int methodPosition, int classPosition) {
Statement statement = getStatementInMethodInClass(statementPosition, methodPosition, classPosition);
ReturnStmt returnStmt = (ReturnStmt) statement;
ConditionalExpr conditionalExpr = (ConditionalExpr)returnStmt.getExpr();
assertThat(conditionalExpr.getElseExpr().getClass().getName(), is(LambdaExpr.class.getName()));
}
示例7: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public Node visit(final ReturnStmt n, final A arg) {
visitComment(n, arg);
if (n.getExpr() != null) {
n.setExpr((Expression) n.getExpr().accept(this, arg));
}
return n;
}
示例8: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public void visit(final ReturnStmt n, final Object arg) {
printJavaComment(n.getComment(), arg);
printer.print("return");
if (n.getExpr() != null) {
printer.print(" ");
n.getExpr().accept(this, arg);
}
printer.print(";");
}
示例9: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public void visit(final ReturnStmt n, final A arg) {
visitComment(n.getComment(), arg);
if (n.getExpr() != null) {
n.getExpr().accept(this, arg);
}
}
示例10: visit
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
@Override public Node visit(final ReturnStmt n, final A arg) {
if (n.getExpr() != null) {
n.setExpr((Expression) n.getExpr().accept(this, arg));
}
return n;
}
示例11: parseReturnStatement
import com.github.javaparser.ast.stmt.ReturnStmt; //导入方法依赖的package包/类
/**
*
* @param rs
* a github javaparser ReturnStatement
* @param attributes
* the list of attributes of the class,
* to potentially get a type from the name
* @param bd
* a body declaration
* @return
* a ReturnStatement structure
*/
private ReturnStatement parseReturnStatement(ReturnStmt rs, List<Attribute> attributes, BodyDeclaration bd) {
ReturnStatement returnStatement = new ReturnStatement();
if (rs.getExpr() != null) {
List<Expr> results = new ArrayList<>();
results.add(parseExpression(rs.getExpr(), attributes, loc));
returnStatement.setResults(results);
}
returnStatement.setLine(rs.getBeginLine() - bd.getBeginLine());
return returnStatement;
}