01: package xdoclet.modules.ojb;
02:
03: /* Copyright 2003-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import xdoclet.DocletTask;
19: import xdoclet.modules.ojb.constraints.ConstraintsBase;
20:
21: /**
22: * A task that executes various OJB-specific sub-tasks.
23: *
24: * @author <a href="mailto:tomdz@users.sourceforge.net">Thomas Dudziak (tomdz@users.sourceforge.net)</a>
25: * @created March 22, 2003
26: * @ant.element name="ojbdoclet" display-name="OJB Task"
27: */
28: public class OjbDocletTask extends DocletTask {
29: /** The amount of checks we perform */
30: private String _checkingLevel = ConstraintsBase.CHECKLEVEL_STRICT;
31:
32: public void setChecks(String level) {
33: if (ConstraintsBase.CHECKLEVEL_NONE.equals(level)) {
34: LogHelper
35: .warn(
36: true,
37: OjbDocletTask.class,
38: "setChecks",
39: "Disabling checks. Please use this level only if you have problems with the other check levels. In this case, please post the problem to the ojb-user mailing list.");
40: _checkingLevel = level;
41: } else if (ConstraintsBase.CHECKLEVEL_BASIC.equals(level)) {
42: LogHelper.warn(true, OjbDocletTask.class, "setChecks",
43: "Disabling strict checks.");
44: _checkingLevel = level;
45: } else if (ConstraintsBase.CHECKLEVEL_STRICT.equals(level)) {
46: _checkingLevel = level;
47: } else {
48: LogHelper.warn(true, OjbDocletTask.class, "setChecks",
49: "Unknown checks value: " + level
50: + ". Using default level "
51: + ConstraintsBase.CHECKLEVEL_STRICT
52: + " instead.");
53: _checkingLevel = ConstraintsBase.CHECKLEVEL_STRICT;
54: }
55: }
56:
57: public String getChecks() {
58: return _checkingLevel;
59: }
60: }
|