int x = 14, y = 3; "int x = 14" and "int y = 3" are
VariableDeclarators.
The type is on all of the variable declarators because, thanks to array brackets, each variable can have a different type.
| Modifier and Type | Field and Description |
|---|---|
| private Expression | |
| private SimpleName | |
| private Type |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | VariableDeclarator(Type type, SimpleName
The identifier for this variable. IE. The variables name. name, Expression What this variable should be initialized to. An initializer)com.
is unnecessary as the = operator is already added.Defines the declaration of a variable. |
| public | VariableDeclarator(TokenRange tokenRange, Type type, SimpleName name, Expression initializer)
This constructor is used by the parser and is considered private. |
| Modifier and Type | Method and Description |
|---|---|
| public <R, A> R | accept(final GenericVisitor<R, A>
the visitor implementation v, final A the argument passed to the visitor (of type A) arg)Implements com. |
| public <A> void | accept(final VoidVisitor<A>
the visitor implementation v, final A any value relevant for the visitor (of type A) arg)Implements com. |
| public VariableDeclarator | |
| protected void | customInitialization()
Overrides com. |
| public Optional | |
| public VariableDeclaratorMetaModel | |
| public SimpleName | |
| public Type | |
| public boolean | |
| public VariableDeclarator | |
| public boolean | |
| public ResolvedValueDeclaration | |
| public VariableDeclarator | Returns: this, the VariableDeclaratorthe initializer expression, can be null initializer)Sets the initializer expression |
| public VariableDeclarator | Returns: this, the VariableDeclaratorthe initializer expression, can be null init)Will create a |
| public VariableDeclarator | setName(final SimpleName name)
Implements com. |
| public VariableDeclarator | setType(final Type
the type type)Implements com. |
| initializer | back to summary |
|---|---|
| private Expression initializer
| |
| name | back to summary |
|---|---|
| private SimpleName name | |
| type | back to summary |
|---|---|
| private Type type | |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator() | |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator(Type type, String variableName) | |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator(Type type, SimpleName name) | |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator(Type type, String variableName, Expression initializer) | |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator(Type type, SimpleName name, Expression initializer) Defines the declaration of a variable.
| |
| VariableDeclarator | back to summary |
|---|---|
| public VariableDeclarator(TokenRange tokenRange, Type type, SimpleName name, Expression initializer) This constructor is used by the parser and is considered private.
| |
| accept | back to summary |
|---|---|
| public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| accept | back to summary |
|---|---|
| public <A> void accept(final VoidVisitor<A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| clone | back to summary |
|---|---|
| public VariableDeclarator clone() Overrides com. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| customInitialization | back to summary |
|---|---|
| protected void customInitialization() Overrides com. Doc from com. Called in every constructor for node specific code. It can't be written in the constructor itself because it will be overwritten during code generation.
| |
| getInitializer | back to summary |
|---|---|
public Optional
| |
| getMetaModel | back to summary |
|---|---|
| public VariableDeclaratorMetaModel getMetaModel() Overrides com.
| |
| getName | back to summary |
|---|---|
| public SimpleName getName() Implements com.
| |
| getType | back to summary |
|---|---|
| public Type getType() Implements com. Doc from com. Gets the type
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Overrides com.
| |
| removeInitializer | back to summary |
|---|---|
public VariableDeclarator removeInitializer()
| |
| replace | back to summary |
|---|---|
| public boolean replace(Node node, Node replacementNode) Overrides com.
| |
| resolve | back to summary |
|---|---|
| public ResolvedValueDeclaration resolve() Implements com.
| |
| setInitializer | back to summary |
|---|---|
| public VariableDeclarator setInitializer(final Expression initializer) Sets the initializer expression
| |
| setInitializer | back to summary |
|---|---|
| public VariableDeclarator setInitializer(String init) Will create a
| |
| setName | back to summary |
|---|---|
| public VariableDeclarator setName(final SimpleName name) Implements com.
| |
| setType | back to summary |
|---|---|
| public VariableDeclarator setType(final Type type) Implements com. Doc from com. Sets the type
| |