本文整理汇总了Java中com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt.getArgs方法的典型用法代码示例。如果您正苦于以下问题:Java ExplicitConstructorInvocationStmt.getArgs方法的具体用法?Java ExplicitConstructorInvocationStmt.getArgs怎么用?Java ExplicitConstructorInvocationStmt.getArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt
的用法示例。
在下文中一共展示了ExplicitConstructorInvocationStmt.getArgs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; //导入方法依赖的package包/类
@Override public void visit(final ExplicitConstructorInvocationStmt n, final A arg) {
visitComment(n.getComment(), arg);
if (!n.isThis()) {
if (n.getExpr() != null) {
n.getExpr().accept(this, arg);
}
}
if (n.getTypeArgs() != null) {
for (final Type t : n.getTypeArgs()) {
t.accept(this, arg);
}
}
if (n.getArgs() != null) {
for (final Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
}
示例2: visit
import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; //导入方法依赖的package包/类
@Override public void visit(final ExplicitConstructorInvocationStmt n, final A arg) {
jw.write(n);
visitComment(n.getComment(), arg);
if (!n.isThis()) {
if (n.getExpr() != null) {
n.getExpr().accept(this, arg);
}
}
if (n.getTypeArgs() != null) {
for (final Type t : n.getTypeArgs()) {
t.accept(this, arg);
}
}
if (n.getArgs() != null) {
for (final Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
}
示例3: visit
import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; //导入方法依赖的package包/类
@Override public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) {
if (!n.isThis()) {
if (n.getExpr() != null) {
n.setExpr((Expression) n.getExpr().accept(this, arg));
}
}
final List<Type> typeArgs = n.getTypeArgs();
if (typeArgs != null) {
for (int i = 0; i < typeArgs.size(); i++) {
typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg));
}
removeNulls(typeArgs);
}
final List<Expression> args = n.getArgs();
if (args != null) {
for (int i = 0; i < args.size(); i++) {
args.set(i, (Expression) args.get(i).accept(this, arg));
}
removeNulls(args);
}
return n;
}
示例4: visit
import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; //导入方法依赖的package包/类
@Override public Node visit(final ExplicitConstructorInvocationStmt n, final A arg) {
visitComment(n, arg);
if (!n.isThis() && n.getExpr() != null) {
n.setExpr((Expression) n.getExpr().accept(this, arg));
}
final List<Type<?>> typeArguments = n.getTypeArguments();
if (typeArguments != null) {
for (int i = 0; i < typeArguments.size(); i++) {
typeArguments.set(i, (Type<?>) typeArguments.get(i).accept(this, arg));
}
removeNulls(typeArguments);
}
final List<Expression> args = n.getArgs();
if (args != null) {
for (int i = 0; i < args.size(); i++) {
args.set(i, (Expression) args.get(i).accept(this, arg));
}
removeNulls(args);
}
return n;
}
示例5: visit
import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; //导入方法依赖的package包/类
@Override
public JCTree visit(final ExplicitConstructorInvocationStmt n, final Object arg) {
//ARG0: List<JCExpression> typeargs
List<JCExpression> arg0 = List.<JCExpression>nil();
if (n.getTypeArgs() != null) {
for (final com.github.javaparser.ast.type.Type t : n.getTypeArgs()) {
arg0 = arg0.append((JCExpression) t.accept(this, arg));
}
}
//ARG1: JCExpression fn
JCExpression arg1;
if (n.isThis()) {
arg1 = new AJCIdent(make.Ident(names.fromString("this")), null);
} else {
if (n.getExpr() != null) {
arg1 = new AJCFieldAccess(make.Select((JCExpression) n.getExpr().accept(this, arg), names.fromString("super")), null);
} else {
arg1 = new AJCIdent(make.Ident(names.fromString("super")), null);
}
}
//ARG2: List<JCExpression> args
List<JCExpression> arg2 = List.<JCExpression>nil();
if (n.getArgs() != null) {
for (final Expression e : n.getArgs()) {
arg2 = arg2.append((JCExpression) e.accept(this, arg));
}
}
// It is expected a Statement, so converting the invocation
return new AJCExpressionStatement(make.Exec(new AJCMethodInvocation(make.Apply(arg0, arg1, arg2), null)), ((n.getComment() != null) ? n.getComment().getContent() : null));
}