KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > jdo > JdoDocletTask


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.modules.jdo;
6
7 import org.apache.tools.ant.BuildException;
8
9 import xdoclet.DocletTask;
10
11 /**
12  * This task that executes various JDO-specific sub-tasks.
13  *
14  * @author Ludovic Claude (ludovicc@users.sourceforge.net)
15  * @author Marco Schulze (nlmarco@users.sourceforge.net) - added JDO 2.0 support (mainly changes in *.xdt)
16  * @created June 11, 20012
17  * @version $Revision: 1.5 $
18  * @ant.element name="jdodoclet" display-name="JDO Task"
19  */

20 public class JdoDocletTask extends DocletTask
21 {
22     /**
23      * Defaults to JDO 1.0.
24      */

25     private String JavaDoc jdoSpec = JdoSpecVersion.JDO_1_0;
26
27     /**
28      * Gets the JdoSpec attribute of the JdoDocletTask object
29      *
30      * @return The JdoSpec value
31      */

32     public String JavaDoc getJdoSpec()
33     {
34         return jdoSpec;
35     }
36
37     /**
38      * Sets the jdo spec to use. Valid values are "1.0" and "2.0". Default is "1.0"
39      *
40      * @param jdoSpec
41      * @ant.not-required.
42      */

43     public void setJdoSpec(JdoSpecVersion jdoSpec)
44     {
45         this.jdoSpec = jdoSpec.getValue();
46     }
47
48     protected void validateOptions() throws BuildException
49     {
50         super.validateOptions();
51     }
52
53     /**
54      * @author Ludovic Claude (ludovicc@users.sourceforge.net)
55      * @created June 11, 20012
56      */

57     public static class JdoSpecVersion extends org.apache.tools.ant.types.EnumeratedAttribute
58     {
59         public final static String JavaDoc JDO_1_0 = "1.0";
60         public final static String JavaDoc JDO_2_0 = "2.0";
61
62         /**
63          * Gets the Values attribute of the JdoSpecVersion object
64          *
65          * @return The Values value
66          */

67         public java.lang.String JavaDoc[] getValues()
68         {
69             return (new java.lang.String JavaDoc[]{
70                 JDO_1_0, JDO_2_0
71                 });
72         }
73     }
74
75 }
76
Popular Tags