RECODER 0.92

recoder.java.declaration
Class VariableDeclaration

java.lang.Object
  extended by recoder.java.JavaSourceElement
      extended by recoder.java.JavaProgramElement
          extended by recoder.java.JavaNonTerminalProgramElement
              extended by recoder.java.declaration.JavaDeclaration
                  extended by recoder.java.declaration.VariableDeclaration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Declaration, NonTerminalProgramElement, ProgramElement, TypeReferenceContainer, SourceElement, ModelElement
Direct Known Subclasses:
FieldDeclaration, LocalVariableDeclaration, ParameterDeclaration

public abstract class VariableDeclaration
extends JavaDeclaration
implements TypeReferenceContainer

Variable declaration.

Author:
AutoDoc
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface recoder.java.ProgramElement
ProgramElement.TreeStructure
 
Nested classes/interfaces inherited from interface recoder.java.SourceElement
SourceElement.Position
 
Field Summary
 
Fields inherited from class recoder.java.JavaSourceElement
factory
 
Fields inherited from interface recoder.java.ProgramElement
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE
 
Constructor Summary
  VariableDeclaration()
          Variable declaration.
  VariableDeclaration(ASTList<DeclarationSpecifier> mods, TypeReference typeRef)
          Variable declaration.
protected VariableDeclaration(VariableDeclaration proto)
          Variable declaration.
 
Method Summary
 SourceElement getFirstElement()
          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  java.util.List<? extends VariableSpecification> getVariables()
          Get variables.
 boolean isFinal()
          Test whether the declaration is final.
 void makeParentRoleValid()
          Make parent role valid.
 void setTypeReference(TypeReference t)
          Set type reference.
 
Methods inherited from class recoder.java.declaration.JavaDeclaration
getAnnotations, getDeclarationSpecifiers, getModifiers, getVisibilityModifier, isAbstract, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictFp, isSynchronized, isTransient, isVolatile, setDeclarationSpecifiers
 
Methods inherited from class recoder.java.JavaNonTerminalProgramElement
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
 
Methods inherited from class recoder.java.JavaProgramElement
getComments, getID, setComments, validate
 
Methods inherited from class recoder.java.JavaSourceElement
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface recoder.java.NonTerminalProgramElement
getChildAt, getChildCount, getChildPositionCode, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, replaceChild, validateAll
 
Methods inherited from interface recoder.java.ProgramElement
getASTParent, getComments, getID, setComments
 
Methods inherited from interface recoder.java.SourceElement
accept, deepClone, getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from interface recoder.ModelElement
validate
 

Constructor Detail

VariableDeclaration

public VariableDeclaration()
Variable declaration.


VariableDeclaration

public VariableDeclaration(ASTList<DeclarationSpecifier> mods,
                           TypeReference typeRef)
Variable declaration.

Parameters:
mods - a modifier mutable list.
typeRef - a type reference.
vars - a variable specification mutable list.

VariableDeclaration

protected VariableDeclaration(VariableDeclaration proto)
Variable declaration.

Parameters:
proto - a variable declaration.
Method Detail

makeParentRoleValid

public void makeParentRoleValid()
Make parent role valid.

Specified by:
makeParentRoleValid in interface NonTerminalProgramElement
Overrides:
makeParentRoleValid in class JavaDeclaration

getFirstElement

public SourceElement getFirstElement()
Description copied from class: JavaSourceElement
Finds the source element that occurs first in the source. The default implementation returns this element, which is correct for all terminal program elements, and many non terminals such as statements and prefixed operators.

Specified by:
getFirstElement in interface SourceElement
Overrides:
getFirstElement in class JavaSourceElement
Returns:
the first source element in the syntactical representation of this element, may be equals to this element.
See Also:
JavaSourceElement.toSource(), JavaSourceElement.getStartPosition()

getLastElement

public SourceElement getLastElement()
Description copied from class: JavaSourceElement
Finds the source element that occurs last in the source. The default implementation returns this element, which is correct for all terminal program elements, and many non terminals such as statements and prefixed operators.

Specified by:
getLastElement in interface SourceElement
Overrides:
getLastElement in class JavaSourceElement
Returns:
the last source element in the syntactical representation of this element, may be equals to this element.
See Also:
JavaSourceElement.toSource(), JavaSourceElement.getEndPosition()

getTypeReferenceCount

public int getTypeReferenceCount()
Get the number of type references in this container.

Specified by:
getTypeReferenceCount in interface TypeReferenceContainer
Returns:
the number of type references.

getTypeReferenceAt

public TypeReference getTypeReferenceAt(int index)
Specified by:
getTypeReferenceAt in interface TypeReferenceContainer

getTypeReference

public TypeReference getTypeReference()
Get type reference.

Returns:
the type reference.

setTypeReference

public void setTypeReference(TypeReference t)
Set type reference.

Parameters:
t - a type reference.

getVariables

public abstract java.util.List<? extends VariableSpecification> getVariables()
Get variables. WARNING: as of 0.80 final, this is not a mutable list any more due to implementation of ParameterDeclaration - changes on this list don't have effects there!!

Returns:
the variable specification mutable list.

isFinal

public boolean isFinal()
Test whether the declaration is final.

Overrides:
isFinal in class JavaDeclaration

RECODER 0.92