VariableDeclarator

constructor()(source)
constructor(type: Type, variableName: String)(source)
constructor(type: Type, name: SimpleName)(source)
constructor(type: Type, variableName: String, initializer: Expression)(source)


constructor(type: Type, name: SimpleName, initializer: Expression)(source)

Defines the declaration of a variable.

Parameters

name

The identifier for this variable. IE. The variables name.

initializer

What this variable should be initialized to. An com.github.javaparser.ast.expr.AssignExpr is unnecessary as the = operator is already added.


constructor(tokenRange: TokenRange, type: Type, name: SimpleName, initializer: Expression)(source)

This constructor is used by the parser and is considered private.