All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.lang.java.ast.ASTArrayInitializer Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
/**
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

package net.sourceforge.pmd.lang.java.ast;

import java.util.Iterator;


/**
 * An array initializer. May occur in two syntactic contexts:
 * 
    *
  • The right-hand side of a {@linkplain ASTVariableDeclarator variable declarator} *
  • Inside an {@linkplain ASTArrayAllocation array allocation expression} *
* *
 *
 * ArrayInitializer ::= "{" ( "," )? "}"
 *                    | "{" {@link ASTExpression Expression} ( "," {@link ASTExpression Expression} )* ( "," )? "}"
 *
 * 
* */ public final class ASTArrayInitializer extends AbstractJavaExpr implements Iterable { ASTArrayInitializer(int id) { super(id); } @Override protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } /** * Return the number of elements. */ public int length() { return getNumChildren(); } @Override public Iterator iterator() { return children(ASTExpression.class).iterator(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy