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

java.lang.Object
  extended by com.caucho.java.gen.ClassComponent
      extended by com.caucho.java.gen.BaseClass
          extended by com.caucho.java.gen.GenClass
              extended by com.caucho.config.gen.BeanGenerator<X>
Direct Known Subclasses:
CandiBeanGenerator, MessageGenerator, SessionGenerator

@Module
public abstract class BeanGenerator<X>
extends GenClass

Generates the skeleton for a bean.


Constructor Summary
protected BeanGenerator(java.lang.String fullClassName, AnnotatedType<X> beanType)
           
 
Method Summary
protected  void addDependency(java.lang.Class<?> cl)
           
protected  void addDependency(PersistentDependency depend)
           
 void generateBeanConstructor(JavaWriter out)
          Generates constructor additions
 void generateBeanConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates constructor additions
 void generateBeanPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates prologue additions
 void generateBusinessMethods(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates view's business methods
 void generateClassStaticFields(JavaWriter out)
           
 void generateContextObjectConstructor(JavaWriter out)
          Generates context object's constructor
protected  void generateDelegate(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
protected  void generateDependency(JavaWriter out)
           
 void generateDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates any global destroy
protected  void generateDestroyImpl(JavaWriter out)
           
 void generateDestroyViews(JavaWriter out)
          Generates the view contents
protected  void generateEpilogue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
 void generateFreeInstance(JavaWriter out, java.lang.String name)
          Frees a bean instance.
protected  void generateInject(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
protected  void generateInjectContent(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
protected  void generateLifecycleMethod(JavaWriter out, int i, java.lang.reflect.Method method, java.lang.String lifecycleType)
           
protected  void generateLifecycleMethodReflection(JavaWriter out, java.util.ArrayList<java.lang.reflect.Method> methods, java.lang.String lifecycleType)
           
protected  void generateLifecycleMethods(JavaWriter out, java.util.ArrayList<java.lang.reflect.Method> methods, java.lang.String lifecycleType)
           
protected  void generatePostConstruct(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
protected  void generatePostConstructImpl(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
           
 void generateProxyConstructor(JavaWriter out)
          Generates constructor additions
 void generateProxyConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates constructor additions
 void generateTimer(JavaWriter out)
          Generates timer code
protected abstract  AspectBeanFactory<X> getAspectBeanFactory()
           
 java.lang.String getBeanClassName()
           
 AnnotatedType<X> getBeanType()
           
protected  AspectBeanFactory<X> getLifecycleAspectFactory()
           
protected  java.util.ArrayList<java.lang.reflect.Method> getLifecycleAspects(java.lang.Class<? extends java.lang.annotation.Annotation> annType)
           
protected  java.lang.String getLifecycleInstance()
           
protected  java.util.ArrayList<java.lang.reflect.Method> getLifecycleMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annType)
           
 java.util.ArrayList<AspectGenerator<X>> getMethods()
          Returns the introspected methods
 java.lang.String getViewClassName()
           
 void introspect()
           
 boolean isProxy()
           
 boolean isRemote()
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.java.gen.GenClass
addImport, generate, generateTopComment, getFullClassName, getPackageName
 
Methods inherited from class com.caucho.java.gen.BaseClass
addComponent, addDependencyComponent, addInterfaceName, addMethod, createMethod, findMethod, generateClassContent, generateComponents, getClassName, setClassName, setStatic, setSuperClassName, setVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanGenerator

protected BeanGenerator(java.lang.String fullClassName,
                        AnnotatedType<X> beanType)
Method Detail

getBeanType

public AnnotatedType<X> getBeanType()

addDependency

protected void addDependency(PersistentDependency depend)

addDependency

protected void addDependency(java.lang.Class<?> cl)

getBeanClassName

public java.lang.String getBeanClassName()

getViewClassName

public java.lang.String getViewClassName()

isRemote

public boolean isRemote()

isProxy

public boolean isProxy()

getMethods

public java.util.ArrayList<AspectGenerator<X>> getMethods()
Returns the introspected methods


getAspectBeanFactory

protected abstract AspectBeanFactory<X> getAspectBeanFactory()

getLifecycleAspectFactory

protected AspectBeanFactory<X> getLifecycleAspectFactory()

introspect

public void introspect()

generateClassStaticFields

public void generateClassStaticFields(JavaWriter out)
                               throws java.io.IOException
Throws:
java.io.IOException

generateDestroyViews

public void generateDestroyViews(JavaWriter out)
                          throws java.io.IOException
Generates the view contents

Throws:
java.io.IOException

generateContextObjectConstructor

public void generateContextObjectConstructor(JavaWriter out)
                                      throws java.io.IOException
Generates context object's constructor

Throws:
java.io.IOException

generateTimer

public void generateTimer(JavaWriter out)
                   throws java.io.IOException
Generates timer code

Throws:
java.io.IOException

generateFreeInstance

public void generateFreeInstance(JavaWriter out,
                                 java.lang.String name)
                          throws java.io.IOException
Frees a bean instance.

Throws:
java.io.IOException

generateDestroy

public void generateDestroy(JavaWriter out,
                            java.util.HashMap<java.lang.String,java.lang.Object> map)
                     throws java.io.IOException
Generates any global destroy

Throws:
java.io.IOException

generateDestroyImpl

protected void generateDestroyImpl(JavaWriter out)
                            throws java.io.IOException
Throws:
java.io.IOException

generateProxyConstructor

public void generateProxyConstructor(JavaWriter out)
                              throws java.io.IOException
Generates constructor additions

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 constructor additions

Throws:
java.io.IOException

generateBeanConstructor

public void generateBeanConstructor(JavaWriter out)
                             throws java.io.IOException
Generates constructor additions

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 constructor additions

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 prologue additions

Throws:
java.io.IOException

generateInject

protected void generateInject(JavaWriter out,
                              java.util.HashMap<java.lang.String,java.lang.Object> map)
                       throws java.io.IOException
Throws:
java.io.IOException

generateInjectContent

protected void generateInjectContent(JavaWriter out,
                                     java.util.HashMap<java.lang.String,java.lang.Object> map)
                              throws java.io.IOException
Throws:
java.io.IOException

generateDelegate

protected void generateDelegate(JavaWriter out,
                                java.util.HashMap<java.lang.String,java.lang.Object> map)
                         throws java.io.IOException
Throws:
java.io.IOException

generatePostConstruct

protected void generatePostConstruct(JavaWriter out,
                                     java.util.HashMap<java.lang.String,java.lang.Object> map)
                              throws java.io.IOException
Throws:
java.io.IOException

generatePostConstructImpl

protected void generatePostConstructImpl(JavaWriter out,
                                         java.util.HashMap<java.lang.String,java.lang.Object> map)
                                  throws java.io.IOException
Throws:
java.io.IOException

generateLifecycleMethodReflection

protected void generateLifecycleMethodReflection(JavaWriter out,
                                                 java.util.ArrayList<java.lang.reflect.Method> methods,
                                                 java.lang.String lifecycleType)
                                          throws java.io.IOException
Throws:
java.io.IOException

generateLifecycleMethods

protected void generateLifecycleMethods(JavaWriter out,
                                        java.util.ArrayList<java.lang.reflect.Method> methods,
                                        java.lang.String lifecycleType)
                                 throws java.io.IOException
Throws:
java.io.IOException

generateLifecycleMethod

protected void generateLifecycleMethod(JavaWriter out,
                                       int i,
                                       java.lang.reflect.Method method,
                                       java.lang.String lifecycleType)
                                throws java.io.IOException
Throws:
java.io.IOException

getLifecycleInstance

protected java.lang.String getLifecycleInstance()

getLifecycleMethods

protected java.util.ArrayList<java.lang.reflect.Method> getLifecycleMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annType)

getLifecycleAspects

protected java.util.ArrayList<java.lang.reflect.Method> getLifecycleAspects(java.lang.Class<? extends java.lang.annotation.Annotation> annType)

generateEpilogue

protected void generateEpilogue(JavaWriter out,
                                java.util.HashMap<java.lang.String,java.lang.Object> map)
                         throws java.io.IOException
Throws:
java.io.IOException

generateBusinessMethods

public void generateBusinessMethods(JavaWriter out,
                                    java.util.HashMap<java.lang.String,java.lang.Object> map)
                             throws java.io.IOException
Generates view's business methods

Throws:
java.io.IOException

generateDependency

protected void generateDependency(JavaWriter out)
                           throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object