@Module public class NonBusinessMethodGenerator<X> extends java.lang.Object implements AspectGenerator<X>
Constructor and Description |
---|
NonBusinessMethodGenerator(AnnotatedMethod<? super X> method) |
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 code for an application (checked) exception.
|
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 code for the invocation itself.
|
void |
generateDestroy(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates destroy code
|
void |
generateEpilogue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates epilogue
|
void |
generateFinally(JavaWriter out)
Generates the code in the finally block
|
void |
generateInject(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates initialization in 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 aspect code after the invocation.
|
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 in the "try" block before the call
|
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.
|
protected java.lang.reflect.Method |
getJavaMethod()
Returns the JavaMethod for this aspect.
|
AnnotatedMethod<? super X> |
getMethod()
Returns the underlying method.
|
protected java.lang.Class<?>[] |
getThrowsExceptions() |
protected java.util.Set<VarType<?>> |
getTypeVariables() |
boolean |
isApplicationExceptionThrown()
Returns true if the application exception can be thrown.
|
protected boolean |
isOverride() |
java.lang.String |
toString() |
public NonBusinessMethodGenerator(AnnotatedMethod<? super X> method)
protected boolean isOverride()
public AnnotatedMethod<? super X> getMethod()
AspectGenerator
getMethod
in interface AspectGenerator<X>
protected java.util.Set<VarType<?>> getTypeVariables()
protected java.lang.reflect.Method getJavaMethod()
protected java.lang.Class<?>[] getThrowsExceptions()
public void generate(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> prologueMap) throws java.io.IOException
generate
in interface AspectGenerator<X>
java.io.IOException
public void generateBeanPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateBeanPrologue
in interface AspectGenerator<X>
java.io.IOException
public void generateBeanConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateBeanConstructor
in interface AspectGenerator<X>
java.io.IOException
public void generateInject(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateInject
in interface AspectGenerator<X>
java.io.IOException
public void generateProxyConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateProxyConstructor
in interface AspectGenerator<X>
java.io.IOException
public void generatePostConstruct(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generatePostConstruct
in interface AspectGenerator<X>
java.io.IOException
public void generatePreDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AspectGenerator
generatePreDestroy
in interface AspectGenerator<X>
java.io.IOException
public void generateEpilogue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AspectGenerator
generateEpilogue
in interface AspectGenerator<X>
java.io.IOException
public void generateDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateDestroy
in interface AspectGenerator<X>
java.io.IOException
public void generateMethodPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateMethodPrologue
in interface AspectGenerator<X>
java.io.IOException
public void generateAsync(JavaWriter out) throws java.io.IOException
generateAsync
in interface AspectGenerator<X>
java.io.IOException
public void generatePreTry(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
[pre-try]
try {
...
}
generatePreTry
in interface AspectGenerator<X>
java.io.IOException
public void generatePreCall(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
...
try {
[pre-call]
ret = super.myMethod(...)
...
}
generatePreCall
in interface AspectGenerator<X>
java.io.IOException
public void generateCall(JavaWriter out) throws java.io.IOException
generateCall
in interface AspectGenerator<X>
java.io.IOException
public void generatePostCall(JavaWriter out) throws java.io.IOException
retType myMethod(...)
{
...
try {
...
ret = super.myMethod(...)
[post-call]
return ret;
} finally {
...
}
}
generatePostCall
in interface AspectGenerator<X>
java.io.IOException
public boolean isApplicationExceptionThrown()
AspectGenerator
isApplicationExceptionThrown
in interface AspectGenerator<X>
public void generateApplicationException(JavaWriter out, java.lang.Class<?> exn) throws java.io.IOException
generateApplicationException
in interface AspectGenerator<X>
java.io.IOException
public void generateSystemException(JavaWriter out, java.lang.Class<?> exn) throws java.io.IOException
generateSystemException
in interface AspectGenerator<X>
java.io.IOException
public void generateFinally(JavaWriter out) throws java.io.IOException
myRet myMethod(...)
{
try {
...
} finally {
[finally]
}
generateFinally
in interface AspectGenerator<X>
java.io.IOException
public void generatePostFinally(JavaWriter out) throws java.io.IOException
AspectGenerator
retType myMethod(...)
{
try {
...
value = bean.myMethod(...);
...
return value;
} finally {
...
}
[post-finally]
}
generatePostFinally
in interface AspectGenerator<X>
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object