|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectrecoder.java.JavaSourceElement
recoder.java.JavaProgramElement
recoder.java.JavaNonTerminalProgramElement
recoder.java.declaration.VariableSpecification
public class VariableSpecification
Variable specification that defines a variable name. This is a part of a
VariableDeclarationand does not contain a
type reference or own modifiers. Note that calls to modifiers are delegated
to the enclosing variable declaration and are therefore discouraged. This was
necessary to subtype Declaration as analyses are interested in the exact
location of a variable name.
| 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 |
| Nested classes/interfaces inherited from interface recoder.java.ProgramElement |
|---|
ProgramElement.TreeStructure |
| Nested classes/interfaces inherited from interface recoder.java.SourceElement |
|---|
SourceElement.Position |
| Nested classes/interfaces inherited from interface recoder.java.ProgramElement |
|---|
ProgramElement.TreeStructure |
| Nested classes/interfaces inherited from interface recoder.java.SourceElement |
|---|
SourceElement.Position |
| Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement |
|---|
ProgramModelElement.LexicalOrder |
| Field Summary |
|---|
| Fields inherited from class recoder.java.JavaSourceElement |
|---|
factory |
| Fields inherited from interface recoder.java.ProgramElement |
|---|
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE |
| Fields inherited from interface recoder.java.ProgramElement |
|---|
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE |
| Fields inherited from interface recoder.java.ProgramElement |
|---|
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE |
| Fields inherited from interface recoder.abstraction.ProgramModelElement |
|---|
LEXICAL_ORDER |
| Fields inherited from interface recoder.bytecode.AccessFlags |
|---|
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Constructor Summary | |
|---|---|
|
VariableSpecification()
Variable specification. |
|
VariableSpecification(Identifier name)
Variable specification. |
|
VariableSpecification(Identifier name,
Expression init)
Variable specification. |
|
VariableSpecification(Identifier name,
int dimensions,
Expression init)
Variable specification. |
protected |
VariableSpecification(VariableSpecification proto)
Variable specification. |
| Method Summary | |
|---|---|
void |
accept(SourceVisitor v)
Receive a visitor, for instance a pretty printer. |
VariableSpecification |
deepClone()
Deep clone. |
NonTerminalProgramElement |
getASTParent()
Get AST parent. |
java.lang.String |
getBinaryName()
Returns the binary name. |
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual" child array |
int |
getChildCount()
Returns the number of children of this node. |
int |
getChildPositionCode(ProgramElement child)
Returns the positional code of the given child, or -1 if
there is no such child. |
ASTList<DeclarationSpecifier> |
getDeclarationSpecifiers()
Get modifiers of the enclosing declaration. |
int |
getDimensions()
Get dimensions. |
Expression |
getExpressionAt(int index)
|
int |
getExpressionCount()
Get the number of expressions in this container. |
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source. |
java.lang.String |
getFullName()
Returns the maximal expanded name including all applicable qualifiers. |
Identifier |
getIdentifier()
Get identifier. |
Expression |
getInitializer()
Get initializer. |
SourceElement |
getLastElement()
Finds the source element that occurs last in the source. |
java.lang.String |
getName()
Get name. |
VariableDeclaration |
getParent()
Get parent. |
ProgramModelInfo |
getProgramModelInfo()
Returns the instance that can retrieve information about this program model element. |
Type |
getType()
Returns the type of this variable. |
boolean |
isFinal()
Test whether the declaration is final. |
boolean |
isStrictFp()
Test whether the declaration is strictfp. |
void |
makeParentRoleValid()
Make parent role valid. |
boolean |
replaceChild(ProgramElement p,
ProgramElement q)
Replace a single child in the current node. |
void |
setDeclarationSpecifiers(ASTList<DeclarationSpecifier> m)
Set modifiers of the enclosing declaration. |
void |
setDimensions(int dimensions)
Set dimensions. |
void |
setIdentifier(Identifier id)
Set identifier. |
void |
setInitializer(Expression expr)
Set initializer. |
void |
setParent(VariableDeclaration parent)
Set parent. |
void |
setProgramModelInfo(ProgramModelInfo service)
Sets the instance that can retrieve information about this program model element. |
| 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 |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.java.ProgramElement |
|---|
getComments, getID, setComments |
| Methods inherited from interface recoder.java.SourceElement |
|---|
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource |
| Methods inherited from interface recoder.ModelElement |
|---|
validate |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.java.ProgramElement |
|---|
getComments, getID, setComments |
| Methods inherited from interface recoder.java.SourceElement |
|---|
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource |
| Methods inherited from interface recoder.ModelElement |
|---|
validate |
| Methods inherited from interface recoder.java.NonTerminalProgramElement |
|---|
getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll |
| Methods inherited from interface recoder.java.ProgramElement |
|---|
getComments, getID, setComments |
| Methods inherited from interface recoder.java.SourceElement |
|---|
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource |
| Methods inherited from interface recoder.ModelElement |
|---|
validate |
| Methods inherited from interface recoder.ModelElement |
|---|
validate |
| Constructor Detail |
|---|
public VariableSpecification()
public VariableSpecification(Identifier name)
name - an identifier.
public VariableSpecification(Identifier name,
Expression init)
name - an identifier.init - an expression.
public VariableSpecification(Identifier name,
int dimensions,
Expression init)
name - an identifier.dimensions - an int value.init - an expression.protected VariableSpecification(VariableSpecification proto)
proto - a variable specification.| Method Detail |
|---|
public VariableSpecification deepClone()
deepClone in interface SourceElementpublic void makeParentRoleValid()
makeParentRoleValid in interface NonTerminalProgramElementmakeParentRoleValid in class JavaNonTerminalProgramElementpublic NonTerminalProgramElement getASTParent()
getASTParent in interface ProgramElementpublic int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child array
java.lang.ArrayIndexOutOfBoundsException - if index is out of boundspublic int getChildPositionCode(ProgramElement child)
NonTerminalProgramElement-1 if
there is no such child. The result contains an encoding of the relative
position of the child as well as the role it has been playing in this
parent element. This information is required internally for proper undo
of transformations and is to be delivered to the detached method of the
ChangeHistory.
getChildPositionCode in interface NonTerminalProgramElementchild - the exact child to look for.
-1.ChangeHistory.detached(recoder.java.ProgramElement, recoder.java.NonTerminalProgramElement, int)
public boolean replaceChild(ProgramElement p,
ProgramElement q)
replaceChild in interface NonTerminalProgramElementp - the old child.p - the new child.
java.lang.ClassCastException - if the new child cannot take over the role of the old one.public void setParent(VariableDeclaration parent)
parent - a variable declaration.public VariableDeclaration getParent()
public int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerpublic final java.lang.String getName()
getName in interface NamedModelElementpublic Identifier getIdentifier()
getIdentifier in interface NamedProgramElementpublic void setIdentifier(Identifier id)
setIdentifier in interface NamedProgramElementid - an identifier.public void setDimensions(int dimensions)
dimensions - an int value.public int getDimensions()
public void setInitializer(Expression expr)
expr - an expression.public Expression getInitializer()
public ASTList<DeclarationSpecifier> getDeclarationSpecifiers()
getDeclarationSpecifiers in interface Declarationpublic void setDeclarationSpecifiers(ASTList<DeclarationSpecifier> m)
setDeclarationSpecifiers in interface Declarationm - a modifier mutable list.public boolean isStrictFp()
public boolean isFinal()
isFinal in interface Variabletrue if this variable is final, false
otherwise.public ProgramModelInfo getProgramModelInfo()
ProgramModelElement
getProgramModelInfo in interface ProgramModelElementpublic void setProgramModelInfo(ProgramModelInfo service)
ProgramModelElement
setProgramModelInfo in interface ProgramModelElementservice - the program model info to be used for this element.public Type getType()
Variable
getType in interface Variablepublic java.lang.String getFullName()
ProgramModelElement
getFullName in interface ProgramModelElementpublic java.lang.String getBinaryName()
ProgramModelElement
getBinaryName in interface ProgramModelElementpublic SourceElement getFirstElement()
JavaSourceElement
getFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()public SourceElement getLastElement()
JavaSourceElement
getLastElement in interface SourceElementgetLastElement in class JavaSourceElementJavaSourceElement.toSource(),
JavaSourceElement.getEndPosition()public void accept(SourceVisitor v)
SourceElement
accept in interface SourceElementv - a source visitor.
|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||