|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A - the type of annotation this handler can processpublic interface MethodAnnotationHandler<A extends Annotation>
Interface for annotation handlers that can process annotations in methods.
This interface exposes both a
preProcessAnnotatedMethod(Annotation, MethodAnnotationContext) and
postProcessAnnotatedMethod(Annotation, MethodAnnotationContext), in
order to let clients perform any instrumentation or context update whenever
they need - after, before or around processing argument annotations.
Although in most scenarios implementing the handling logic in either on
preprocesing or postprocessing is the same, there are specific cases where
the distinction is important. Typical case is when a
MethodAnnotationHandler instruments a method by surrounding it with
some kind of block - a try-catch, for instance: if that instrumentation is
performing during preprocessing, and then, an
ArgumentAnnotationHandler that discovers an annotation on the same
method inserts some portion of code, that code may be placed after or before
the block. However, if performed on postprocessing, such portion of code will
be always surrounded by the block.
AnnotationHandler| Method Summary | |
|---|---|
void |
postProcessAnnotatedMethod(A annotation,
MethodAnnotationContext context)
Process an annotation discovered in a method by the
instrumenter, instrumenting the given context where the
annotation was found. |
void |
preProcessAnnotatedMethod(A annotation,
MethodAnnotationContext context)
Process an annotation discovered in a method by the
instrumenter, instrumenting the given context where the
annotation was found. |
| Methods inherited from interface net.sf.staccatocommons.instrument.handler.AnnotationHandler |
|---|
getSupportedAnnotationType |
| Method Detail |
|---|
void preProcessAnnotatedMethod(@NonNull
A annotation,
@NonNull
MethodAnnotationContext context)
throws javassist.CannotCompileException,
javassist.NotFoundException
annotation discovered in a method by the
instrumenter, instrumenting the given context where the
annotation was found. This message is sent by the instrumenter before
discovering any argument annotation.
annotation - the annotation to processcontext - the instrumentable context where the annotation was found
javassist.CannotCompileException - if compilation errors occur during instrumentation
javassist.NotFoundException - if any type needed by instrumentation was not found
void postProcessAnnotatedMethod(@NonNull
A annotation,
@NonNull
MethodAnnotationContext context)
throws javassist.CannotCompileException,
javassist.NotFoundException
annotation discovered in a method by the
instrumenter, instrumenting the given context where the
annotation was found. This message is sent by the instrumenter after
discovering and processing all arguments annotations.
annotation - the annotation to processcontext - the instrumentable context where the annotation was found
javassist.CannotCompileException - if compilation errors occur during instrumentation
javassist.NotFoundException - if any type needed by instrumentation was not found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||