KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > ojb > OjbDocletTask


1 package xdoclet.modules.ojb;
2
3 /* Copyright 2003-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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 {
30     /** The amount of checks we perform */
31     private String JavaDoc _checkingLevel = ConstraintsBase.CHECKLEVEL_STRICT;
32
33     public void setChecks(String JavaDoc level)
34     {
35         if (ConstraintsBase.CHECKLEVEL_NONE.equals(level))
36         {
37             LogHelper.warn(true,
38                            OjbDocletTask.class,
39                            "setChecks",
40                            "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.");
41             _checkingLevel = level;
42         }
43         else if (ConstraintsBase.CHECKLEVEL_BASIC.equals(level))
44         {
45             LogHelper.warn(true,
46                            OjbDocletTask.class,
47                            "setChecks",
48                            "Disabling strict checks.");
49             _checkingLevel = level;
50         }
51         else if (ConstraintsBase.CHECKLEVEL_STRICT.equals(level))
52         {
53             _checkingLevel = level;
54         }
55         else
56         {
57             LogHelper.warn(true,
58                            OjbDocletTask.class,
59                            "setChecks",
60                            "Unknown checks value: "+level+". Using default level "+ConstraintsBase.CHECKLEVEL_STRICT+" instead.");
61             _checkingLevel = ConstraintsBase.CHECKLEVEL_STRICT;
62         }
63     }
64
65     public String JavaDoc getChecks()
66     {
67         return _checkingLevel;
68     }
69 }
70
Popular Tags