01: /*
02: * FindBugs - Find Bugs in Java programs
03: * Copyright (C) 2005, University of Maryland
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package edu.umd.cs.findbugs.config;
21:
22: import edu.umd.cs.findbugs.ba.AnalysisContext;
23:
24: /**
25: * Configure a specific boolean analysis property.
26: *
27: * @author David Hovemeyer
28: */
29: public class AnalysisFeatureSetting {
30: private int property;
31: private boolean enabled;
32:
33: /**
34: * Constructor.
35: *
36: * @param property the analysis property to configure
37: * @param enabled true if the property is enabled, false if not
38: */
39: public AnalysisFeatureSetting(int property, boolean enabled) {
40: this .property = property;
41: this .enabled = enabled;
42: }
43:
44: /**
45: * Set the configured value of the analysis property in the given
46: * AnalysisContext.
47: *
48: * @param analysisContext the AnalysisContext
49: */
50: public void configure(AnalysisContext analysisContext) {
51: analysisContext.setBoolProperty(property, enabled);
52: }
53: }
|