@Module public interface AspectGenerator<X>
[method-prologue]
MyType foo(args)
{
[pre-try]
try {
[pre-call]
value = [call]
[post-call]
return value;
} catch (ApplicationException e) {
[application-exception]
throw e;
} catch (RuntimeException e) {
[system-exception]
throw e;
} finally {
[finally]
}
[post-finally]
}
Modifier and Type | Method and Description |
---|---|
void |
generate(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> prologueMap)
Top-level generator.
|
void |
generateApplicationException(JavaWriter out,
java.lang.Class<?> exn)
Generates application (checked) exception code for
the method.
|
void |
generateAsync(JavaWriter out) |
void |
generateBeanConstructor(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates initialization in the constructor
|
void |
generateBeanPrologue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates the static class prologue
|
void |
generateCall(JavaWriter out)
Generates the method interception code
|
void |
generateDestroy(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates any destroy lifecycle code.
|
void |
generateEpilogue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates epilogue
|
void |
generateFinally(JavaWriter out)
Generates finally code for the method
|
void |
generateInject(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates inject code after the constructor
|
void |
generateMethodPrologue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates the static class prologue
|
void |
generatePostCall(JavaWriter out)
Generates code after the call, before the return.
|
void |
generatePostConstruct(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates @PostConstruct code
|
void |
generatePostFinally(JavaWriter out)
Generates finally code for the method
|
void |
generatePreCall(JavaWriter out)
Generates code before the call, in the try block.
|
void |
generatePreDestroy(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates @PreDestroy code
|
void |
generatePreTry(JavaWriter out)
Generates code before the try block
|
void |
generateProxyConstructor(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates initialization in the proxy constructor
|
void |
generateSystemException(JavaWriter out,
java.lang.Class<?> exn)
Generates system (runtime) exception code for
the method.
|
AnnotatedMethod<? super X> |
getMethod()
Returns the underlying method.
|
boolean |
isApplicationExceptionThrown()
Returns true if the application exception can be thrown.
|
AnnotatedMethod<? super X> getMethod()
void generate(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> prologueMap) throws java.io.IOException
java.io.IOException
void generateBeanPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateBeanConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateProxyConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateInject(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generatePostConstruct(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generatePreDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateEpilogue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateMethodPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
void generateAsync(JavaWriter out) throws java.io.IOException
java.io.IOException
void generatePreTry(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
[pre-try]
try {
...
}
java.io.IOException
void generatePreCall(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
try {
[pre-call]
value = bean.myMethod(...);
...
}
java.io.IOException
void generateCall(JavaWriter out) throws java.io.IOException
java.io.IOException
void generatePostCall(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
try {
...
value = bean.myMethod(...);
[post-call]
return value;
} finally {
...
}
}
java.io.IOException
boolean isApplicationExceptionThrown()
void generateApplicationException(JavaWriter out, java.lang.Class<?> exn) throws java.io.IOException
java.io.IOException
void generateSystemException(JavaWriter out, java.lang.Class<?> exn) throws java.io.IOException
java.io.IOException
void generateFinally(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
try {
...
value = bean.myMethod(...);
...
return value;
} finally {
[finally]
}
}
java.io.IOException
void generatePostFinally(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
try {
...
value = bean.myMethod(...);
...
return value;
} finally {
...
}
[post-finally]
}
java.io.IOException