org.objectweb.speedo.genclass.merger
Class GenClassMerger

java.lang.Object
  extended byMatchingTask
      extended byorg.objectweb.speedo.genclass.merger.GenClassMerger

public class GenClassMerger
extends MatchingTask

Author:
S.Chassande-Barrioz
See Also:
Serialized Form

Field Summary
static java.lang.String CONSTRUCTOR_DESC
           
static java.lang.String[][] CONSTRUCTOR_PARAM
           
static java.lang.String GEN_CLASS_NAME
           
static java.lang.String LOGGER_NAME
           
 
Constructor Summary
GenClassMerger()
           
GenClassMerger(org.objectweb.util.monolog.api.Logger logger)
           
 
Method Summary
 void _setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void execute()
           
 java.io.File getSrc()
           
protected  org.objectweb.asm.ClassReader loadJavaClass(java.lang.String filename, boolean remove)
          Loads a specified class.
 void mergeGenClass(java.lang.String gcn)
           
 void setSrc(java.io.File src)
           
protected  void writeJavaClass(java.lang.String filename, org.objectweb.asm.ClassWriter jclass)
          Saves the new bytecode of the specified Java class under a specified base directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_NAME

public static final java.lang.String LOGGER_NAME
See Also:
Constant Field Values

GEN_CLASS_NAME

public static final java.lang.String GEN_CLASS_NAME

CONSTRUCTOR_PARAM

public static final java.lang.String[][] CONSTRUCTOR_PARAM

CONSTRUCTOR_DESC

public static final java.lang.String CONSTRUCTOR_DESC
Constructor Detail

GenClassMerger

public GenClassMerger()

GenClassMerger

public GenClassMerger(org.objectweb.util.monolog.api.Logger logger)
Method Detail

_setLogger

public void _setLogger(org.objectweb.util.monolog.api.Logger logger)

getSrc

public java.io.File getSrc()

setSrc

public void setSrc(java.io.File src)

execute

public void execute()
             throws BuildException
Throws:
BuildException

mergeGenClass

public void mergeGenClass(java.lang.String gcn)
                   throws SpeedoException
Throws:
SpeedoException

loadJavaClass

protected org.objectweb.asm.ClassReader loadJavaClass(java.lang.String filename,
                                                      boolean remove)
                                               throws SpeedoException
Loads a specified class.

Parameters:
filename - is the file name of the .class to load. the file name is a relative patht to the 'src' directory.
remove - indicates if the .class must be removed
Returns:
the JavaClass loaded
Throws:
SpeedoException - if the file cannot be loaded

writeJavaClass

protected void writeJavaClass(java.lang.String filename,
                              org.objectweb.asm.ClassWriter jclass)
                       throws SpeedoException
Saves the new bytecode of the specified Java class under a specified base directory.

Parameters:
jclass - the Java class that has to be saved
Throws:
SpeedoException - if the file cannot be written