recoder.java.declaration
Class AnnotationPropertyDeclaration
java.lang.Object
recoder.java.JavaSourceElement
recoder.java.JavaProgramElement
recoder.java.JavaNonTerminalProgramElement
recoder.java.declaration.JavaDeclaration
recoder.java.declaration.MethodDeclaration
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
| 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.bytecode.AccessFlags |
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 -
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.