net.sf.staccatocommons.instrument.context.internal
Class DefaultMethodAnnotationContext
java.lang.Object
net.sf.staccatocommons.instrument.context.internal.AbstractAnnotationContext
net.sf.staccatocommons.instrument.context.internal.DefaultMethodAnnotationContext
- All Implemented Interfaces:
- AnnotationContext, MethodAnnotationContext
public class DefaultMethodAnnotationContext
- extends AbstractAnnotationContext
- implements MethodAnnotationContext
- Author:
- flbulgarelli
|
Method Summary |
javassist.CtClass |
getDeclaringClass()
Answers the class were the annotated element is declared. |
javassist.CtClass |
getElementType()
Returns the type of the element annotated:
When the annotated element is a class, the type is that class
When the annotated element is a constructor, the type is the class that
declared such constructor
When the annotated element is a method, the type is the return type of
the method
When the annotated element is an argument, the type is argument type
|
javassist.CtMethod |
getMethod()
|
String |
getReturnIdentifier()
|
boolean |
isPublic()
If this annotated contextis public, that is:
When the annotated element is a class, method or constructor, whether
it is marked with the Java public keyword
When the annotated element is an argument, whether the enclosing
CtBehavior is public
|
boolean |
isVoid()
|
void |
setMethod(javassist.CtMethod method)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultMethodAnnotationContext
public DefaultMethodAnnotationContext(javassist.ClassPool pool,
org.slf4j.Logger logger)
- Creates a new
DefaultMethodAnnotationContext
getMethod
public javassist.CtMethod getMethod()
- Specified by:
getMethod in interface MethodAnnotationContext
- Returns:
- the method
setMethod
public void setMethod(javassist.CtMethod method)
- Parameters:
method - the method to set
getReturnIdentifier
public String getReturnIdentifier()
- Specified by:
getReturnIdentifier in interface MethodAnnotationContext
- Returns:
- The name of the pseudo-variable that represents the return value
getDeclaringClass
public javassist.CtClass getDeclaringClass()
- Description copied from interface:
AnnotationContext
- Answers the class were the annotated element is declared. If the annotated
element is already a top level or anonymous class, returns it.
- Specified by:
getDeclaringClass in interface AnnotationContext
- Returns:
- the declaring class of the annotated element
isVoid
public boolean isVoid()
- Specified by:
isVoid in interface MethodAnnotationContext
- Returns:
- if the annotated method is void
getElementType
public javassist.CtClass getElementType()
throws javassist.NotFoundException
- Description copied from interface:
AnnotationContext
- Returns the type of the element annotated:
- When the annotated element is a class, the type is that class
- When the annotated element is a constructor, the type is the class that
declared such constructor
- When the annotated element is a method, the type is the return type of
the method
- When the annotated element is an argument, the type is argument type
- Specified by:
getElementType in interface AnnotationContext
- Returns:
- a
CtClass that represents the type of the annotated element
- Throws:
javassist.NotFoundException - if such type is not available
isPublic
public boolean isPublic()
- Description copied from interface:
AnnotationContext
- If this annotated contextis public, that is:
- When the annotated element is a class, method or constructor, whether
it is marked with the Java public keyword
- When the annotated element is an argument, whether the enclosing
CtBehavior is public
Copyright © 2010-2012 Staccatocommons. All Rights Reserved.