|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.janino.tools.JGrep
public class JGrep
Reads a set of compilation units from the file system and searches it for specific Java™ constructs, e.g. invocations of a particular method. Usage:
java org.codehaus.janino.JGrep \ [ -dirs directory-name-patterns ] \ [ -files file-name-patterns ] \ { directory-path } \ -method-invocation class.method(arg-types) java org.codehaus.janino.JGrep -helpIf "-dirs" is not given, then all directory-pathes are scanned for files. The directory-name-patterns work as described in
StringPattern.parseCombinedPattern(String)
.
If "-files" is not given, then all files ending in ".java" are read. The
file-name-patterns work as described in
StringPattern.parseCombinedPattern(String)
.
Nested Class Summary | |
---|---|
static interface |
JGrep.MethodInvocationAction
|
static interface |
JGrep.MethodInvocationPredicate
|
Constructor Summary | |
---|---|
JGrep(java.io.File[] classPath,
java.io.File[] optionalExtDirs,
java.io.File[] optionalBootClassPath,
java.lang.String optionalCharacterEncoding,
boolean verbose)
|
|
JGrep(IClassLoader iClassLoader,
java.lang.String optionalCharacterEncoding,
boolean verbose)
|
Method Summary | |
---|---|
static java.io.File |
getClassFile(java.lang.String className,
java.io.File sourceFile,
java.io.File optionalDestinationDirectory)
Construct the name of a file that could store the byte code of the class with the given name. |
void |
jGrep(java.io.File[] rootDirectories,
StringPattern[] directoryNamePatterns,
StringPattern[] fileNamePatterns,
java.util.List methodInvocationTargets)
|
void |
jGrep(java.util.Iterator sourceFilesIterator,
java.util.List methodInvocationTargets)
|
static void |
main(java.lang.String[] args)
Command line interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JGrep(java.io.File[] classPath, java.io.File[] optionalExtDirs, java.io.File[] optionalBootClassPath, java.lang.String optionalCharacterEncoding, boolean verbose)
public JGrep(IClassLoader iClassLoader, java.lang.String optionalCharacterEncoding, boolean verbose)
Method Detail |
---|
public static void main(java.lang.String[] args)
public void jGrep(java.io.File[] rootDirectories, StringPattern[] directoryNamePatterns, StringPattern[] fileNamePatterns, java.util.List methodInvocationTargets) throws CompileException, java.io.IOException
CompileException
java.io.IOException
public void jGrep(java.util.Iterator sourceFilesIterator, java.util.List methodInvocationTargets) throws CompileException, java.io.IOException
CompileException
java.io.IOException
public static java.io.File getClassFile(java.lang.String className, java.io.File sourceFile, java.io.File optionalDestinationDirectory)
If optionalDestinationDirectory
is non-null, the returned path is the
optionalDestinationDirectory
plus the package of the class (with dots replaced
with file separators) plus the class name plus ".class". Example:
"destdir/pkg1/pkg2/Outer$Inner.class"
If optionalDestinationDirectory
is null, the returned path is the
directory of the sourceFile
plus the class name plus ".class". Example:
"srcdir/Outer$Inner.class"
className
- E.g. "pkg1.pkg2.Outer$Inner"sourceFile
- E.g. "srcdir/Outer.java"optionalDestinationDirectory
- E.g. "destdir"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |