public class Analyzer
extends java.lang.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 | Description |
|---|---|
Analyzer(ExecutionDataStore executionData,
ICoverageVisitor coverageVisitor) |
Creates a new analyzer reporting to the given output.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
analyzeAll(java.io.File file) |
Analyzes all class files contained in the given file or folder.
|
int |
analyzeAll(java.io.InputStream input,
java.lang.String location) |
Analyzes all classes found in the given input stream.
|
int |
analyzeAll(java.lang.String path,
java.io.File basedir) |
Analyzes all classes from the given class path.
|
void |
analyzeClass(byte[] buffer,
java.lang.String location) |
Analyzes the class definition from a given in-memory buffer.
|
void |
analyzeClass(java.io.InputStream input,
java.lang.String location) |
Analyzes the class definition from a given input stream.
|
void |
analyzeClass(org.objectweb.asm.ClassReader reader) |
Analyzes the class given as a ASM reader.
|
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,
java.lang.String location)
throws java.io.IOException
buffer - class definitionslocation - a location description used for exception messagesjava.io.IOException - if the class can't be analyzedpublic void analyzeClass(java.io.InputStream input,
java.lang.String location)
throws java.io.IOException
InputStream is not closed by this method.input - stream to read class definition fromlocation - a location description used for exception messagesjava.io.IOException - if the stream can't be read or the class can't be analyzedpublic int analyzeAll(java.io.InputStream input,
java.lang.String location)
throws java.io.IOException
InputStream is
not closed by this method.input - input datalocation - a location description used for exception messagesjava.io.IOException - if the stream can't be read or a class can't be analyzedpublic int analyzeAll(java.io.File file)
throws java.io.IOException
file - file or folder to look for class filesjava.io.IOException - if the file can't be read or a class can't be analyzedpublic int analyzeAll(java.lang.String path,
java.io.File basedir)
throws java.io.IOException
path - path definitionbasedir - optional base directory, if null the current
working directory is used as the base for relative path
entriesjava.io.IOException - if a file can't be read or a class can't be analyzedCopyright © 2018. All rights reserved.