1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
*
* This program and the accompanying materials are made available under
* the terms of the Common Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/cpl-v10.html
*
* $Id: CoverageOptionsFactory.java,v 1.1.2.1 2004/06/27 22:58:26 vlad_r Exp $
*/
package com.vladium.emma.data;
import java.util.Properties;
import com.vladium.emma.instr.InstrProcessor;
import com.vladium.util.IProperties;
import com.vladium.util.Property;
// ----------------------------------------------------------------------------
/**
* @author Vlad Roubtsov, (C) 2004
*/
public
abstract class CoverageOptionsFactory
{
// public: ................................................................
public static CoverageOptions create (final Properties properties)
{
final boolean excludeSyntheticMethods =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_EXCLUDE_SYNTHETIC_METHODS,
InstrProcessor.DEFAULT_EXCLUDE_SYNTHETIC_METHODS));
final boolean excludeBridgeMethods =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_EXCLUDE_BRIDGE_METHODS,
InstrProcessor.DEFAULT_EXCLUDE_BRIDGE_METHODS));
final boolean doSUIDCompensaton =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_DO_SUID_COMPENSATION,
InstrProcessor.DEFAULT_DO_SUID_COMPENSATION));
return new CoverageOptions (excludeSyntheticMethods, excludeBridgeMethods, doSUIDCompensaton);
}
public static CoverageOptions create (final IProperties properties)
{
final boolean excludeSyntheticMethods =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_EXCLUDE_SYNTHETIC_METHODS,
InstrProcessor.DEFAULT_EXCLUDE_SYNTHETIC_METHODS));
final boolean excludeBridgeMethods =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_EXCLUDE_BRIDGE_METHODS,
InstrProcessor.DEFAULT_EXCLUDE_BRIDGE_METHODS));
final boolean doSUIDCompensaton =
Property.toBoolean (properties.getProperty (InstrProcessor.PROPERTY_DO_SUID_COMPENSATION,
InstrProcessor.DEFAULT_DO_SUID_COMPENSATION));
return new CoverageOptions (excludeSyntheticMethods, excludeBridgeMethods, doSUIDCompensaton);
}
// protected: .............................................................
// package: ...............................................................
// private: ...............................................................
private CoverageOptionsFactory () {} // this class is not extendible
} // end of class
// ----------------------------------------------------------------------------
|