public class Analyzer extends Object
Analyzer instance processes a set of Java class files and
calculates coverage data for them. For each class file the result is reported
to a given ICoverageVisitor instance. In addition the
Analyzer requires a ExecutionDataStore instance that holds
the execution data for the classes to analyze. The Analyzer offers
several methods to analyze classes from a variety of sources.| Constructor and Description |
|---|
Analyzer(ExecutionDataStore executionData,
ICoverageVisitor coverageVisitor)
Creates a new analyzer reporting to the given output.
|
| Modifier and Type | Method and Description |
|---|---|
int |
analyzeAll(File file)
Analyzes all class files contained in the given file or folder.
|
int |
analyzeAll(InputStream input)
Analyzes all classes found in the given input stream.
|
int |
analyzeAll(String path,
File basedir)
Analyzes all classes from the given class path.
|
int |
analyzeArchive(InputStream input)
Analyzes all classes contained in the ZIP archive (jar, war, ear, etc.)
given as an input stream.
|
void |
analyzeClass(byte[] buffer)
Analyzes the class definition from a given in-memory buffer.
|
void |
analyzeClass(org.objectweb.asm.ClassReader reader)
Analyzes the class given as a ASM reader.
|
void |
analyzeClass(InputStream input)
Analyzes the class definition from a given input stream.
|
public Analyzer(ExecutionDataStore executionData, ICoverageVisitor coverageVisitor)
executionData - execution datacoverageVisitor - the output instance that will coverage data for every analyzed
classpublic void analyzeClass(org.objectweb.asm.ClassReader reader)
reader - reader with class definitionspublic void analyzeClass(byte[] buffer)
buffer - class definitionspublic void analyzeClass(InputStream input) throws IOException
input - stream to read class definition fromIOExceptionpublic int analyzeArchive(InputStream input) throws IOException
input - ZIP archive dataIOExceptionpublic int analyzeAll(InputStream input) throws IOException
input - input dataIOExceptionpublic int analyzeAll(File file) throws IOException
file - file or folder to look for class filesIOExceptionpublic int analyzeAll(String path, File basedir) throws IOException
path - path definitionbasedir - optional base directory, if null the current
working directory is used as the base for relative path
entriesIOExceptionCopyright © 2009-2012 Mountainminds GmbH & Co. KG. All Rights Reserved.