org.jacoco.core.runtime
Class AgentOptions

java.lang.Object
  extended by org.jacoco.core.runtime.AgentOptions

public class AgentOptions
extends Object

Utility to create and parse options for the runtime agent. Options are represented as a string in the following format:

   key1=value1,key2=value2,key3=value3
 

Version:
$Revision: $
Author:
Marc R. Hoffmann

Field Summary
static String EXCLCLASSLOADER
          Wildcard expression for class loaders names for classes that should be excluded from code coverage.
static String EXCLUDES
          Wildcard expression for class names that should be excluded from code coverage.
static String FILE
          Specifies the output file for execution data.
static String INCLUDES
          Wildcard expression for class names that should be included for code coverage.
static String MERGE
          Specifies whether execution data should be appended to the output file.
 
Constructor Summary
AgentOptions()
          New instance with all values set to default.
AgentOptions(String optionstr)
          New instance parsed from the given option string.
 
Method Summary
 String getExclClassloader()
          Returns the wildcard expression for excluded class loaders.
 String getExcludes()
          Returns the wildcard expression for classes to exclude.
 String getFile()
          Returns the output file location.
 String getIncludes()
          Returns the wildcard expression for classes to include.
 boolean getMerge()
          Returns whether the output should be merged with an existing file.
 void setExclClassloader(String expression)
          Sets the wildcard expression for excluded class loaders.
 void setExcludes(String excludes)
          Sets the wildcard expression for classes to exclude.
 void setFile(String file)
          Sets the output file location.
 void setIncludes(String includes)
          Sets the wildcard expression for classes to include.
 void setMerge(boolean flag)
          Sets whether the output should be merged with an existing file.
 String toString()
          Creates a string representation that can be passed to the agent via the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE

public static final String FILE
Specifies the output file for execution data. Default is jacoco.exec in the working directory.

See Also:
Constant Field Values

MERGE

public static final String MERGE
Specifies whether execution data should be appended to the output file. Default is true.

See Also:
Constant Field Values

INCLUDES

public static final String INCLUDES
Wildcard expression for class names that should be included for code coverage. Default is * (all classes included).

See Also:
WildcardMatcher, Constant Field Values

EXCLUDES

public static final String EXCLUDES
Wildcard expression for class names that should be excluded from code coverage. Default is the empty string (no exclusions).

See Also:
WildcardMatcher, Constant Field Values

EXCLCLASSLOADER

public static final String EXCLCLASSLOADER
Wildcard expression for class loaders names for classes that should be excluded from code coverage. This means all classes loaded by a class loader which full qualified name matches this expression will be ignored for code coverage regardless of all other filtering settings. Default is sun.reflect.DelegatingClassLoader.

See Also:
WildcardMatcher, Constant Field Values
Constructor Detail

AgentOptions

public AgentOptions()
New instance with all values set to default.


AgentOptions

public AgentOptions(String optionstr)
New instance parsed from the given option string.

Parameters:
optionstr - string to parse or null
Method Detail

getFile

public String getFile()
Returns the output file location.

Returns:
output file location

setFile

public void setFile(String file)
Sets the output file location.

Parameters:
file - output file location

getMerge

public boolean getMerge()
Returns whether the output should be merged with an existing file.

Returns:
true, when the output should be merged

setMerge

public void setMerge(boolean flag)
Sets whether the output should be merged with an existing file.

Parameters:
flag - true, when the output should be merged

getIncludes

public String getIncludes()
Returns the wildcard expression for classes to include.

Returns:
wildcard expression for classes to include
See Also:
WildcardMatcher

setIncludes

public void setIncludes(String includes)
Sets the wildcard expression for classes to include.

Parameters:
includes - wildcard expression for classes to include
See Also:
WildcardMatcher

getExcludes

public String getExcludes()
Returns the wildcard expression for classes to exclude.

Returns:
wildcard expression for classes to exclude
See Also:
WildcardMatcher

setExcludes

public void setExcludes(String excludes)
Sets the wildcard expression for classes to exclude.

Parameters:
excludes - wildcard expression for classes to exclude
See Also:
WildcardMatcher

getExclClassloader

public String getExclClassloader()
Returns the wildcard expression for excluded class loaders.

Returns:
expression for excluded class loaders
See Also:
WildcardMatcher

setExclClassloader

public void setExclClassloader(String expression)
Sets the wildcard expression for excluded class loaders.

Parameters:
expression - expression for excluded class loaders
See Also:
WildcardMatcher

toString

public String toString()
Creates a string representation that can be passed to the agent via the command line. Might be the empty string, if no options are set.

Overrides:
toString in class Object