RECODER 0.92

recoder.java.declaration
Class AnnotationPropertyDeclaration

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.MethodDeclaration
                      extended by recoder.java.declaration.AnnotationPropertyDeclaration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, AnnotationProperty, ClassTypeContainer, Member, Method, ProgramModelElement, AccessFlags, Declaration, MemberDeclaration, TypeDeclarationContainer, ExpressionContainer, NamedProgramElement, NonTerminalProgramElement, ParameterContainer, ProgramElement, TypeReferenceContainer, ScopeDefiningElement, SourceElement, StatementContainer, TypeScope, VariableScope, ModelElement, NamedModelElement

public class AnnotationPropertyDeclaration
extends MethodDeclaration
implements AnnotationProperty, ExpressionContainer

Author:
gutzmann
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement
ProgramModelElement.LexicalOrder
 
Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement
ProgramModelElement.LexicalOrder
 
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.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
 
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
 
Fields inherited from interface recoder.java.ProgramElement
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE
 
Constructor Summary
  AnnotationPropertyDeclaration()
           
protected AnnotationPropertyDeclaration(AnnotationPropertyDeclaration proto)
           
  AnnotationPropertyDeclaration(ASTList<DeclarationSpecifier> modifiers, TypeReference returnType, Identifier name, Expression defaultValue)
           
 
Method Summary
 void accept(SourceVisitor v)
          Receive a visitor, for instance a pretty printer.
 AnnotationPropertyDeclaration deepClone()
          Deep clone.
 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.
 java.lang.Object getDefaultValue()
          Returns the default value for the annotation member represented by this Method instance.
 Expression getDefaultValueExpression()
           
 Expression getExpressionAt(int index)
           
 int getExpressionCount()
          Get the number of expressions in this container.
 boolean isPrivate()
          Test whether the declaration is private.
 boolean isProtected()
          Test whether the declaration is protected.
 boolean isPublic()
          Test whether the declaration is public.
 boolean isVarArgMethod()
          Checks if this method takes a variable number of arguments.
 void makeParentRoleValid()
          Make parent role valid.
 boolean replaceChild(ProgramElement p, ProgramElement q)
          Replace a single child in the current node.
 void setDefaultValue(Expression e)
           
 
Methods inherited from class recoder.java.declaration.MethodDeclaration
addTypeToScope, addVariableToScope, getASTParent, getBinaryName, getBody, getContainer, getContainingClassType, getExceptions, getFirstElement, getFullName, getIdentifier, getLastElement, getMemberParent, getName, getPackage, getParameterDeclarationAt, getParameterDeclarationCount, getParameters, getProgramModelInfo, getReturnType, getSignature, getStatementAt, getStatementCount, getThrown, getTypeDeclarationAt, getTypeDeclarationCount, getTypeInScope, getTypeParameters, getTypeReference, getTypeReferenceAt, getTypeReferenceCount, getTypes, getTypesInScope, getVariableInScope, getVariablesInScope, isAbstract, isDefinedScope, isFinal, isNative, isStatic, isStrictFp, isSynchronized, removeTypeFromScope, removeVariableFromScope, setBody, setDefinedScope, setIdentifier, setMemberParent, setParameters, setProgramModelInfo, setThrown, setTypeParameters, setTypeReference, toString
 
Methods inherited from class recoder.java.declaration.JavaDeclaration
getAnnotations, getDeclarationSpecifiers, getModifiers, getVisibilityModifier, 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, wait, wait, wait
 
Methods inherited from interface recoder.abstraction.Method
getExceptions, getReturnType, getSignature, getTypeParameters, isAbstract, isNative, isSynchronized
 
Methods inherited from interface recoder.abstraction.Member
getAnnotations, getContainingClassType, isFinal, isStatic, isStrictFp
 
Methods inherited from interface recoder.abstraction.ProgramModelElement
getBinaryName, getFullName, getProgramModelInfo, setProgramModelInfo
 
Methods inherited from interface recoder.NamedModelElement
getName
 
Methods inherited from interface recoder.ModelElement
validate
 
Methods inherited from interface recoder.abstraction.ClassTypeContainer
getContainer, getPackage, getTypes
 
Methods inherited from interface recoder.abstraction.ProgramModelElement
getBinaryName, getFullName, getProgramModelInfo, setProgramModelInfo
 
Methods inherited from interface recoder.NamedModelElement
getName
 
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
getASTParent, getComments, getID, setComments
 
Methods inherited from interface recoder.java.SourceElement
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
 
Methods inherited from interface recoder.java.Declaration
getDeclarationSpecifiers, setDeclarationSpecifiers
 

Constructor Detail

AnnotationPropertyDeclaration

public AnnotationPropertyDeclaration()

AnnotationPropertyDeclaration

public AnnotationPropertyDeclaration(ASTList<DeclarationSpecifier> modifiers,
                                     TypeReference returnType,
                                     Identifier name,
                                     Expression defaultValue)
Parameters:
modifiers -
returnType -
name -
parameters -
exceptions -

AnnotationPropertyDeclaration

protected AnnotationPropertyDeclaration(AnnotationPropertyDeclaration proto)
Parameters:
proto -
Method Detail

getDefaultValue

public java.lang.Object getDefaultValue()
Description copied from interface: AnnotationProperty
Returns the default value for the annotation member represented by this Method instance. Returns null if no default is associated with the member, or if the method instance does not represent a declared member of an annotation type.

Specified by:
getDefaultValue in interface AnnotationProperty
Returns:
the default value for the annotation member represented by this Method instance.

getDefaultValueExpression

public Expression getDefaultValueExpression()

setDefaultValue

public void setDefaultValue(Expression e)

makeParentRoleValid

public void makeParentRoleValid()
Description copied from class: MethodDeclaration
Make parent role valid.

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

getExpressionCount

public int getExpressionCount()
Description copied from interface: ExpressionContainer
Get the number of expressions in this container.

Specified by:
getExpressionCount in interface ExpressionContainer
Returns:
the number of expressions.

getExpressionAt

public Expression getExpressionAt(int index)
Specified by:
getExpressionAt in interface ExpressionContainer

accept

public void accept(SourceVisitor v)
Description copied from interface: SourceElement
Receive a visitor, for instance a pretty printer.

Specified by:
accept in interface SourceElement
Overrides:
accept in class MethodDeclaration
Parameters:
v - a source visitor.

deepClone

public AnnotationPropertyDeclaration deepClone()
Description copied from class: MethodDeclaration
Deep clone.

Specified by:
deepClone in interface SourceElement
Overrides:
deepClone in class MethodDeclaration
Returns:
the object.

getChildAt

public ProgramElement getChildAt(int index)
Description copied from class: MethodDeclaration
Returns the child at the specified index in this node's "virtual" child array

Specified by:
getChildAt in interface NonTerminalProgramElement
Overrides:
getChildAt in class MethodDeclaration
Parameters:
index - an index into this node's "virtual" child array
Returns:
the program element at the given position

getChildCount

public int getChildCount()
Description copied from class: MethodDeclaration
Returns the number of children of this node.

Specified by:
getChildCount in interface NonTerminalProgramElement
Overrides:
getChildCount in class MethodDeclaration
Returns:
an int giving the number of children of this node

getChildPositionCode

public int getChildPositionCode(ProgramElement child)
Description copied from interface: NonTerminalProgramElement
Returns the positional code of the given child, or -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.

Specified by:
getChildPositionCode in interface NonTerminalProgramElement
Overrides:
getChildPositionCode in class MethodDeclaration
Parameters:
child - the exact child to look for.
Returns:
the positional code of the given child, or -1.
See Also:
ChangeHistory.detached(recoder.java.ProgramElement, recoder.java.NonTerminalProgramElement, int)

isPrivate

public boolean isPrivate()
Description copied from class: MethodDeclaration
Test whether the declaration is private.

Specified by:
isPrivate in interface Member
Specified by:
isPrivate in interface MemberDeclaration
Overrides:
isPrivate in class MethodDeclaration
Returns:
true if this member is private, false otherwise.

isProtected

public boolean isProtected()
Description copied from class: MethodDeclaration
Test whether the declaration is protected.

Specified by:
isProtected in interface Member
Specified by:
isProtected in interface MemberDeclaration
Overrides:
isProtected in class MethodDeclaration
Returns:
true if this member is protected, false otherwise.

isPublic

public boolean isPublic()
Description copied from class: MethodDeclaration
Test whether the declaration is public. Methods of interfaces are always public.

Specified by:
isPublic in interface Member
Specified by:
isPublic in interface MemberDeclaration
Overrides:
isPublic in class MethodDeclaration
Returns:
true if this member is public, false otherwise.

isVarArgMethod

public boolean isVarArgMethod()
Description copied from interface: Method
Checks if this method takes a variable number of arguments.

Specified by:
isVarArgMethod in interface Method
Overrides:
isVarArgMethod in class MethodDeclaration
Returns:
true if this methods takes a variable number of arguments, false otherwise.

replaceChild

public boolean replaceChild(ProgramElement p,
                            ProgramElement q)
Description copied from class: MethodDeclaration
Replace a single child in the current node. The child to replace is matched by identity and hence must be known exactly. The replacement element can be null - in that case, the child is effectively removed. The parent role of the new child is validated, while the parent link of the replaced child is left untouched.

Specified by:
replaceChild in interface NonTerminalProgramElement
Overrides:
replaceChild in class MethodDeclaration
Parameters:
p - the old child.
Returns:
true if a replacement has occured, false otherwise.

RECODER 0.92