public abstract class VariableDeclaration extends JavaDeclaration implements TypeReferenceContainer
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
parentIsInterfaceDeclaration
this field stores if parent is an InterfaceDeclaration because we will be
unable to walk the tree upwards to check this
|
protected TypeReference |
typeReference
Type reference.
|
modArray| Constructor and Description |
|---|
VariableDeclaration()
Variable declaration.
|
VariableDeclaration(ExtList children,
boolean parentIsInterfaceDeclaration)
Variable declaration.
|
VariableDeclaration(ImmutableArray<Modifier> mods,
TypeReference typeRef,
boolean parentIsInterfaceDeclaration)
Variable declaration.
|
VariableDeclaration(Modifier[] mods,
TypeReference typeRef,
boolean parentIsInterfaceDeclaration)
Variable declaration.
|
| Modifier and Type | Method and Description |
|---|---|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
TypeReference |
getTypeReference()
Get type reference.
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount()
Get the number of type references in this container.
|
abstract ImmutableArray<? extends VariableSpecification> |
getVariables()
Get variables.
|
boolean |
isFinal()
Test whether the declaration is final.
|
boolean |
parentIsInterfaceDeclaration()
this field stores if parent is an InterfaceDeclaration because we will be
unable to walk the tree upwards to check this
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
getModifiers, getStateCount, getVisibilityModifier, isAbstract, isGhost, isModel, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictFp, isSynchronized, isTransient, isVolatilecompatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildAt, getChildCountgetComments, matchequalsModRenaming, getEndPosition, getPositionInfo, getRelativePosition, getStartPositionprotected final TypeReference typeReference
protected final boolean parentIsInterfaceDeclaration
public VariableDeclaration()
public VariableDeclaration(Modifier[] mods, TypeReference typeRef, boolean parentIsInterfaceDeclaration)
mods - a modifier mutable list.typeRef - a type reference.parentIsInterfaceDeclaration - a boolean set true iff
the parent is an InterfaceDeclarationpublic VariableDeclaration(ImmutableArray<Modifier> mods, TypeReference typeRef, boolean parentIsInterfaceDeclaration)
mods - a modifier immutable list.typeRef - a type reference.parentIsInterfaceDeclaration - a boolean set true iff
the parent is an InterfaceDeclarationpublic VariableDeclaration(ExtList children, boolean parentIsInterfaceDeclaration)
children - an ExtList of children. May
include:
a TypeReference (as reference to the type of the declared variable)
several Modifier (taken as modifiers of the declaration),
CommentsparentIsInterfaceDeclaration - a boolean set true iff
the parent is an InterfaceDeclarationpublic SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()public SourceElement getFirstElementIncludingBlocks()
SourceElementgetFirstElementIncludingBlocks in interface SourceElementgetFirstElementIncludingBlocks in class JavaSourceElementSourceElement.getStartPosition()public SourceElement getLastElement()
JavaSourceElementgetLastElement in interface SourceElementgetLastElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getEndPosition()public int getTypeReferenceCount()
getTypeReferenceCount in interface TypeReferenceContainerpublic TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt in interface TypeReferenceContainerpublic TypeReference getTypeReference()
public abstract ImmutableArray<? extends VariableSpecification> getVariables()
public boolean isFinal()
isFinal in class JavaDeclarationpublic boolean parentIsInterfaceDeclaration()
public void visit(Visitor v)
visit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.