org.objectweb.speedo.genclass.merger
Class GenClassMerger

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.MatchingTask
              extended byorg.objectweb.speedo.genclass.merger.GenClassMerger
All Implemented Interfaces:
SelectorContainer

public class GenClassMerger
extends MatchingTask

Author:
S.Chassande-Barrioz

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
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
GenClassMerger()
           
GenClassMerger(Logger logger)
           
 
Method Summary
 void _setLogger(Logger logger)
           
 void execute()
           
 java.io.File getSrc()
           
protected  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, ClassWriter jclass)
          Saves the new bytecode of the specified Java class under a specified base directory.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
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(Logger logger)
Method Detail

_setLogger

public void _setLogger(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 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,
                              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