|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.weaver.WeaveRunner
public class WeaveRunner
Takes jar or class files and weaves the bytecode based on the given configuration. A weaver object should be created, and passed to the setWeaver() method. The weaver object is what does the actual byte code weaving.
Field Summary | |
---|---|
static URLClassLoader |
loader
|
Constructor Summary | |
---|---|
WeaveRunner()
Creates a weave runner with no Weaver (org.jboss.weaver.Weaver). |
|
WeaveRunner(Weaver weaver)
|
Method Summary | |
---|---|
void |
addFilesFromSourcePathFile(String sourcePathFile)
|
void |
addSourcePath(String path)
|
void |
appendClassPath(javassist.ClassPool pool,
String classpath)
|
static String |
argUsage()
Create a string describing the available options for the parseArgs method. |
void |
clearSourcePaths()
|
void |
compileFile(ClassFileInfo info)
|
void |
copyFile(File source,
File dest)
|
void |
copyFile(File file,
String sourcePath,
String destPath)
Copies the file from the source path into the destination. |
javassist.bytecode.ClassFile |
createClassFile(InputStream is)
|
String |
getClassName(InputStream is)
Get the name of a class from a given input stream |
String |
getOutputDir()
|
String |
getOutputJar()
|
ArrayList<String> |
getSourcePaths()
|
Weaver |
getWeaver()
|
boolean |
isCopyResourceFiles()
Whether to copy files that are not translated to the output directory. |
boolean |
isSuppress()
|
boolean |
isUsingSystemClasspath()
|
boolean |
isVerbose()
|
void |
parseArgs(String[] args)
Parses command line arguments and calls setters. |
void |
setCopyResourceFiles(boolean copyResourceFiles)
Determines whether to copy files that are not translated to the output directory. |
void |
setOutputDir(String outputPath)
|
void |
setOutputJar(String outputJar)
|
void |
setSourcePaths(ArrayList<String> sourcePaths)
|
void |
setSuppress(boolean suppress)
|
void |
setUsingSystemClasspath(boolean usingSystemClasspath)
|
void |
setVerbose(boolean verbose)
|
void |
setWeaver(String weaverClass)
|
void |
setWeaver(Weaver weaver)
|
void |
weave()
|
void |
weave(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static URLClassLoader loader
Constructor Detail |
---|
public WeaveRunner()
public WeaveRunner(Weaver weaver)
Method Detail |
---|
public void parseArgs(String[] args)
args
- public void appendClassPath(javassist.ClassPool pool, String classpath) throws javassist.NotFoundException
javassist.NotFoundException
public void weave(String[] args) throws javassist.NotFoundException, IOException
javassist.NotFoundException
IOException
public void weave() throws javassist.NotFoundException, IOException
javassist.NotFoundException
IOException
public String getClassName(InputStream is) throws IOException
is
- The stream with the class file data
IOException
public javassist.bytecode.ClassFile createClassFile(InputStream is) throws IOException
IOException
public void addFilesFromSourcePathFile(String sourcePathFile)
public void copyFile(File file, String sourcePath, String destPath) throws IOException
file
-
IOException
public void copyFile(File source, File dest) throws IOException
IOException
public void compileFile(ClassFileInfo info) throws javassist.bytecode.BadBytecode, javassist.CannotCompileException
javassist.bytecode.BadBytecode
javassist.CannotCompileException
public String getOutputDir()
public void setOutputDir(String outputPath)
public String getOutputJar()
public void setOutputJar(String outputJar)
public void addSourcePath(String path)
public ArrayList<String> getSourcePaths()
public void setSourcePaths(ArrayList<String> sourcePaths)
public void clearSourcePaths()
public Weaver getWeaver()
public void setWeaver(Weaver weaver)
public void setWeaver(String weaverClass)
public boolean isSuppress()
public void setSuppress(boolean suppress)
public boolean isVerbose()
public void setVerbose(boolean verbose)
public boolean isUsingSystemClasspath()
public void setUsingSystemClasspath(boolean usingSystemClasspath)
public boolean isCopyResourceFiles()
public void setCopyResourceFiles(boolean copyResourceFiles)
copyResourceFiles
- public static String argUsage()
parseArgs
method.
Available options
-verbose
-suppress
(-classpath | -cp) <classpath>
-weaverClass <WeaverClass>
-outputDir
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |