本文整理匯總了Java中com.github.javaparser.ast.body.MethodDeclaration.getArrayCount方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodDeclaration.getArrayCount方法的具體用法?Java MethodDeclaration.getArrayCount怎麽用?Java MethodDeclaration.getArrayCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.javaparser.ast.body.MethodDeclaration
的用法示例。
在下文中一共展示了MethodDeclaration.getArrayCount方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override
public Node visit(MethodDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
Type type_ = cloneNodes(_n.getType(), _arg);
List<Parameter> parameters = visit(_n.getParameters(), _arg);
List<ReferenceType> throws_ = visit(_n.getThrows(), _arg);
BlockStmt block = cloneNodes(_n.getBody(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
MethodDeclaration r = new MethodDeclaration(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block
);
r.setComment(comment);
return r;
}
示例2: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override
public Node visit(MethodDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
Type type_ = cloneNodes(_n.getType(), _arg);
List<Parameter> parameters = visit(_n.getParameters(), _arg);
List<NameExpr> throws_ = visit(_n.getThrows(), _arg);
BlockStmt block = cloneNodes(_n.getBody(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
MethodDeclaration r = new MethodDeclaration(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, typeParameters, type_, _n.getName(), parameters, _n.getArrayCount(), throws_, block
);
r.setComment(comment);
return r;
}
示例3: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override
public void visit(final MethodDeclaration n, final Object arg) {
printer.printLn("MethodDeclaration");
printOrphanCommentsBeforeThisChildNode(n);
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
if (n.isDefault()) {
printer.print("default ");
}
printTypeParameters(n.getTypeParameters(), arg);
if (n.getTypeParameters() != null) {
printer.print(" ");
}
n.getType().accept(this, arg);
printer.print(" ");
printer.print(n.getName());
printer.print("(");
if (n.getParameters() != null) {
for (final Iterator<Parameter> i = n.getParameters().iterator(); i.hasNext(); ) {
final Parameter p = i.next();
p.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.print(")");
for (int i = 0; i < n.getArrayCount(); i++) {
printer.print("[]");
}
if (!isNullOrEmpty(n.getThrows())) {
printer.print(" throws ");
for (final Iterator<NameExpr> i = n.getThrows().iterator(); i.hasNext(); ) {
final NameExpr name = i.next();
name.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (n.getBody() == null) {
printer.print(";");
} else {
printer.print(" ");
n.getBody().accept(this, arg);
}
}
示例4: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override public Boolean visit(final MethodDeclaration n1, final Node arg) {
final MethodDeclaration n2 = (MethodDeclaration) arg;
// javadoc are checked at CompilationUnit
if (n1.getModifiers() != n2.getModifiers()) {
return Boolean.FALSE;
}
if (n1.getArrayCount() != n2.getArrayCount()) {
return Boolean.FALSE;
}
if (!objEquals(n1.getName(), n2.getName())) {
return Boolean.FALSE;
}
if (!nodeEquals(n1.getType(), n2.getType())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
return Boolean.FALSE;
}
if (!nodeEquals(n1.getBody(), n2.getBody())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getParameters(), n2.getParameters())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getThrows(), n2.getThrows())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) {
return Boolean.FALSE;
}
if(n1.isDefault() != n2.isDefault()){
return Boolean.FALSE;
}
return Boolean.TRUE;
}
示例5: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override public void visit(final MethodDeclaration n, final Object arg) {
printOrphanCommentsBeforeThisChildNode(n);
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
if (n.isDefault()) {
printer.print("default ");
}
printTypeParameters(n.getTypeParameters(), arg);
if (!isNullOrEmpty(n.getTypeParameters())) {
printer.print(" ");
}
n.getType().accept(this, arg);
printer.print(" ");
printer.print(n.getName());
printer.print("(");
if (!isNullOrEmpty(n.getParameters())) {
for (final Iterator<Parameter> i = n.getParameters().iterator(); i.hasNext();) {
final Parameter p = i.next();
p.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.print(")");
for (int i = 0; i < n.getArrayCount(); i++) {
printer.print("[]");
}
if (!isNullOrEmpty(n.getThrows())) {
printer.print(" throws ");
for (final Iterator<ReferenceType> i = n.getThrows().iterator(); i.hasNext();) {
final ReferenceType name = i.next();
name.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (n.getBody() == null) {
printer.print(";");
} else {
printer.print(" ");
n.getBody().accept(this, arg);
}
}
示例6: visit
import com.github.javaparser.ast.body.MethodDeclaration; //導入方法依賴的package包/類
@Override public void visit(final MethodDeclaration n, final Object arg) {
printOrphanCommentsBeforeThisChildNode(n);
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
printMemberAnnotations(n.getAnnotations(), arg);
printModifiers(n.getModifiers());
if (n.isDefault()) {
printer.print("default ");
}
printTypeParameters(n.getTypeParameters(), arg);
if (n.getTypeParameters() != null) {
printer.print(" ");
}
n.getType().accept(this, arg);
printer.print(" ");
printer.print(n.getName());
printer.print("(");
if (n.getParameters() != null) {
for (final Iterator<Parameter> i = n.getParameters().iterator(); i.hasNext();) {
final Parameter p = i.next();
p.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
printer.print(")");
for (int i = 0; i < n.getArrayCount(); i++) {
printer.print("[]");
}
if (!isNullOrEmpty(n.getThrows())) {
printer.print(" throws ");
for (final Iterator<NameExpr> i = n.getThrows().iterator(); i.hasNext();) {
final NameExpr name = i.next();
name.accept(this, arg);
if (i.hasNext()) {
printer.print(", ");
}
}
}
if (n.getBody() == null) {
printer.print(";");
} else {
printer.print(" ");
n.getBody().accept(this, arg);
}
}