com.caucho.amber.gen
Class AmberEnhancer

java.lang.Object
  extended by com.caucho.amber.gen.AmberEnhancer
All Implemented Interfaces:
AmberGenerator, ClassEnhancer

public class AmberEnhancer
extends java.lang.Object
implements AmberGenerator, ClassEnhancer

Enhancing the java objects for Amber mapping.


Constructor Summary
AmberEnhancer(AmberContainer amberContainer)
           
 
Method Summary
 void compile()
          Compiles the pending classes.
 void configure(AbstractEnhancedType type)
          Parses the configuration file.
 void enhance(GenClass genClass, JClass baseClass, java.lang.String extClassName)
          Enhances the class.
 void generate(AbstractEnhancedType type)
          Generates the type.
 void generateJava(JavaClassGenerator javaGen, AbstractEnhancedType type)
          Generates the type.
 Path getPostWorkDir()
          Returns the work directory.
 Path getWorkDir()
          Returns the work directory.
 void init()
          Initialize the enhancer.
protected  boolean isModified(java.lang.Class preloadedClass)
          Checks to see if the preloaded class is modified.
protected  EntityType loadEntityTypeImpl(java.lang.Class cl, java.lang.ClassLoader rawLoader)
           
 void postEnhance(JavaClass baseClass)
          Enhances the class.
 void preEnhance(JavaClass baseClass)
          Enhances the class.
 void setConfigDirectory(Path dir)
          Sets the config directory.
 boolean shouldEnhance(java.lang.String className)
          Returns true if the class should be enhanced.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AmberEnhancer

public AmberEnhancer(AmberContainer amberContainer)
Method Detail

setConfigDirectory

public void setConfigDirectory(Path dir)
Sets the config directory.


getWorkDir

public Path getWorkDir()
Returns the work directory.


getPostWorkDir

public Path getPostWorkDir()
Returns the work directory.


init

public void init()
          throws java.lang.Exception
Initialize the enhancer.

Throws:
java.lang.Exception

isModified

protected boolean isModified(java.lang.Class preloadedClass)
Checks to see if the preloaded class is modified.


shouldEnhance

public boolean shouldEnhance(java.lang.String className)
Returns true if the class should be enhanced.

Specified by:
shouldEnhance in interface ClassEnhancer

loadEntityTypeImpl

protected EntityType loadEntityTypeImpl(java.lang.Class cl,
                                        java.lang.ClassLoader rawLoader)

preEnhance

public void preEnhance(JavaClass baseClass)
                throws java.lang.Exception
Enhances the class.

Specified by:
preEnhance in interface ClassEnhancer
Throws:
java.lang.Exception

enhance

public void enhance(GenClass genClass,
                    JClass baseClass,
                    java.lang.String extClassName)
             throws java.lang.Exception
Enhances the class.

Specified by:
enhance in interface ClassEnhancer
Throws:
java.lang.Exception

generate

public void generate(AbstractEnhancedType type)
              throws java.lang.Exception
Generates the type.

Specified by:
generate in interface AmberGenerator
Throws:
java.lang.Exception

generateJava

public void generateJava(JavaClassGenerator javaGen,
                         AbstractEnhancedType type)
                  throws java.lang.Exception
Generates the type.

Specified by:
generateJava in interface AmberGenerator
Throws:
java.lang.Exception

compile

public void compile()
             throws java.lang.Exception
Compiles the pending classes.

Specified by:
compile in interface AmberGenerator
Throws:
java.lang.Exception

postEnhance

public void postEnhance(JavaClass baseClass)
                 throws java.lang.Exception
Enhances the class.

Specified by:
postEnhance in interface ClassEnhancer
Throws:
java.lang.Exception

configure

public void configure(AbstractEnhancedType type)
               throws ConfigException,
                      java.io.IOException
Parses the configuration file.

Specified by:
configure in interface AmberGenerator
Throws:
ConfigException
java.io.IOException

toString

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