KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > invicta > type > TargetImpl


1 package net.sf.invicta.type;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5 import java.util.StringTokenizer JavaDoc;
6
7 import net.sf.invicta.InvictaConstants;
8 import net.sf.invicta.api.Target;
9
10 /**
11  *
12  */

13 public class TargetImpl implements Target {
14
15     protected List JavaDoc dependsList = new ArrayList JavaDoc();
16     protected String JavaDoc name;
17     protected String JavaDoc ifString;
18     protected String JavaDoc unlessString;
19     protected String JavaDoc description;
20
21     /**
22      * Constructor for TargetImpl.
23      */

24     public TargetImpl() {
25         super();
26     }
27     
28     /**
29      * Constructor for TargetImpl.
30      */

31     public TargetImpl(Target other) {
32         super();
33         this.name = other.getName();
34         this.dependsList = other.getDependsList();
35         this.description = other.getDescription();
36         this.ifString = other.getIf();
37         this.unlessString = other.getUnless();
38     }
39     
40     /**
41      * Returns the name of the target.
42      * @return String. Target name. For example: 'compile'.
43      */

44     public String JavaDoc getName() {
45         return name;
46     }
47     
48     /**
49      * Sets the name.
50      * @param name The name to set
51      */

52     public void setName(String JavaDoc name) {
53         this.name = name;
54     }
55
56     /**
57      * Required for digester.
58      */

59     public String JavaDoc getDepends() {
60         return null;
61     }
62     
63     /**
64      *
65      */

66     public void setDepends(String JavaDoc dependsListStr) {
67         StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(dependsListStr, InvictaConstants.DEPEND_LIST_DELIMITER);
68         while (st.hasMoreTokens())
69             this.dependsList.add(st.nextToken().trim());
70     }
71     
72     /**
73      * Returns a list of target names (or handler calls) that this target
74      * depends on.
75      * @return List of String objects.
76      */

77     public List JavaDoc getDependsList() {
78         return this.dependsList;
79     }
80     
81     /**
82      * Returns the description of the target.
83      * @return String
84      */

85     public String JavaDoc getDescription() {
86         return this.description;
87     }
88
89     /**
90      * Returns the value of the 'if' conditional attribute of the target.
91      * @return String
92      */

93     public String JavaDoc getIf() {
94         return this.ifString;
95     }
96
97     /**
98      * Returns the value of the 'unless' conditional attribute of the target.
99      * @return String
100      */

101     public String JavaDoc getUnless() {
102         return this.unlessString;
103     }
104
105     /**
106      * Sets the description.
107      * @param description The description to set
108      */

109     public void setDescription(String JavaDoc description) {
110         this.description = description;
111     }
112
113     /**
114      * Sets the ifString.
115      * @param ifString The ifString to set
116      */

117     public void setIf(String JavaDoc ifString) {
118         this.ifString = ifString;
119     }
120
121     /**
122      * Sets the unlessString.
123      * @param unlessString The unlessString to set
124      */

125     public void setUnless(String JavaDoc unlessString) {
126         this.unlessString = unlessString;
127     }
128
129 }
130
Popular Tags