com.caucho.config.gen
Class NullGenerator<X>

java.lang.Object
  extended by com.caucho.config.gen.NullGenerator<X>
All Implemented Interfaces:
AspectGenerator<X>
Direct Known Subclasses:
AsynchronousGenerator, MethodTailGenerator

@Module
public class NullGenerator<X>
extends java.lang.Object
implements AspectGenerator<X>

Represents a filter for invoking a method


Field Summary
static NullGenerator<?> NULL
           
 
Method Summary
 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 bean instance interception
 void generateBeanPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates the bean instance 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 bean injection
 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 bean post construct interception
 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 bean instance interception
 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()
          True if the application exceptions are thrown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static NullGenerator<?> NULL
Method Detail

getMethod

public AnnotatedMethod<? super X> getMethod()
Description copied from interface: AspectGenerator
Returns the underlying method.

Specified by:
getMethod in interface AspectGenerator<X>

generate

public void generate(JavaWriter out,
                     java.util.HashMap<java.lang.String,java.lang.Object> prologueMap)
              throws java.io.IOException
Description copied from interface: AspectGenerator
Top-level generator.

Specified by:
generate in interface AspectGenerator<X>
Throws:
java.io.IOException

generateBeanPrologue

public void generateBeanPrologue(JavaWriter out,
                                 java.util.HashMap<java.lang.String,java.lang.Object> map)
                          throws java.io.IOException
Generates the bean instance class prologue

Specified by:
generateBeanPrologue in interface AspectGenerator<X>
Throws:
java.io.IOException

generateBeanConstructor

public void generateBeanConstructor(JavaWriter out,
                                    java.util.HashMap<java.lang.String,java.lang.Object> map)
                             throws java.io.IOException
Generates bean instance interception

Specified by:
generateBeanConstructor in interface AspectGenerator<X>
Throws:
java.io.IOException

generateProxyConstructor

public void generateProxyConstructor(JavaWriter out,
                                     java.util.HashMap<java.lang.String,java.lang.Object> map)
                              throws java.io.IOException
Generates bean instance interception

Specified by:
generateProxyConstructor in interface AspectGenerator<X>
Throws:
java.io.IOException

generateInject

public void generateInject(JavaWriter out,
                           java.util.HashMap<java.lang.String,java.lang.Object> map)
                    throws java.io.IOException
Generates bean injection

Specified by:
generateInject in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePostConstruct

public void generatePostConstruct(JavaWriter out,
                                  java.util.HashMap<java.lang.String,java.lang.Object> map)
                           throws java.io.IOException
Generates bean post construct interception

Specified by:
generatePostConstruct in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePreDestroy

public void generatePreDestroy(JavaWriter out,
                               java.util.HashMap<java.lang.String,java.lang.Object> map)
                        throws java.io.IOException
Description copied from interface: AspectGenerator
Generates @PreDestroy code

Specified by:
generatePreDestroy in interface AspectGenerator<X>
Throws:
java.io.IOException

generateEpilogue

public void generateEpilogue(JavaWriter out,
                             java.util.HashMap<java.lang.String,java.lang.Object> map)
                      throws java.io.IOException
Description copied from interface: AspectGenerator
Generates epilogue

Specified by:
generateEpilogue in interface AspectGenerator<X>
Throws:
java.io.IOException

generateDestroy

public void generateDestroy(JavaWriter out,
                            java.util.HashMap<java.lang.String,java.lang.Object> map)
                     throws java.io.IOException
Description copied from interface: AspectGenerator
Generates any destroy lifecycle code.

Specified by:
generateDestroy in interface AspectGenerator<X>
Throws:
java.io.IOException

generateMethodPrologue

public void generateMethodPrologue(JavaWriter out,
                                   java.util.HashMap<java.lang.String,java.lang.Object> map)
                            throws java.io.IOException
Generates the static class prologue

Specified by:
generateMethodPrologue in interface AspectGenerator<X>
Throws:
java.io.IOException

generateAsync

public void generateAsync(JavaWriter out)
                   throws java.io.IOException
Specified by:
generateAsync in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePreTry

public void generatePreTry(JavaWriter out)
                    throws java.io.IOException
Generates code before the try block
 retType myMethod(...)
 {
   [pre-try]
   try {
     ...
 }
 

Specified by:
generatePreTry in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePreCall

public void generatePreCall(JavaWriter out)
                     throws java.io.IOException
Generates code before the call, in the try block.
 retType myMethod(...)
 {
   try {
     [pre-call]
     value = bean.myMethod(...);
     ...
 }
 

Specified by:
generatePreCall in interface AspectGenerator<X>
Throws:
java.io.IOException

generateCall

public void generateCall(JavaWriter out)
                  throws java.io.IOException
Generates the method interception code

Specified by:
generateCall in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePostCall

public void generatePostCall(JavaWriter out)
                      throws java.io.IOException
Generates code after the call, before the return.
 retType myMethod(...)
 {
   try {
     ...
     value = bean.myMethod(...);
     [post-call]
     return value;
   } finally {
     ...
   }
 }
 

Specified by:
generatePostCall in interface AspectGenerator<X>
Throws:
java.io.IOException

isApplicationExceptionThrown

public boolean isApplicationExceptionThrown()
True if the application exceptions are thrown

Specified by:
isApplicationExceptionThrown in interface AspectGenerator<X>

generateApplicationException

public void generateApplicationException(JavaWriter out,
                                         java.lang.Class<?> exn)
                                  throws java.io.IOException
Generates application (checked) exception code for the method.

Specified by:
generateApplicationException in interface AspectGenerator<X>
Throws:
java.io.IOException

generateSystemException

public void generateSystemException(JavaWriter out,
                                    java.lang.Class<?> exn)
                             throws java.io.IOException
Generates system (runtime) exception code for the method.

Specified by:
generateSystemException in interface AspectGenerator<X>
Throws:
java.io.IOException

generateFinally

public void generateFinally(JavaWriter out)
                     throws java.io.IOException
Generates finally code for the method

Specified by:
generateFinally in interface AspectGenerator<X>
Throws:
java.io.IOException

generatePostFinally

public void generatePostFinally(JavaWriter out)
                         throws java.io.IOException
Generates finally code for the method

Specified by:
generatePostFinally in interface AspectGenerator<X>
Throws:
java.io.IOException