KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > invicta > project > DependItemImpl


1 package net.sf.invicta.project;
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.api.DependItem;
8  
9 /**
10  *
11  *
12  */

13 public class DependItemImpl implements DependItem {
14      
15     // Digester related members
16
protected String JavaDoc name;
17     protected boolean export;
18     protected List JavaDoc productNames = new ArrayList JavaDoc(); // List of String objects
19

20     /**
21      * Constructor for DependItem.
22      */

23     public DependItemImpl() {
24         super();
25     }
26     
27     /**
28      * @param name
29      * @param export
30      */

31     public DependItemImpl(String JavaDoc name, boolean export) {
32         super();
33         this.name = name;
34         this.export = export;
35     }
36
37     /**
38      * Returns whether this dependency is exported to components that depends
39      * on this component.
40      * @return boolean
41      */

42     public boolean getExport() {
43         return export;
44     }
45     
46     /**
47      * Returns the name of the component that this depend item defines
48      * dependency on.
49      * @return String
50      */

51     public String JavaDoc getName() {
52         return name;
53     }
54
55     /**
56      * Sets the export.
57      * @param export The export to set
58      */

59     public void setExport(boolean export) {
60         this.export = export;
61     }
62
63     /**
64      * Sets the products.
65      * @param products The products to set
66      */

67     public void setProducts(String JavaDoc productsStr) {
68         StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(productsStr, ",");
69         while (st.hasMoreTokens())
70             this.productNames.add(st.nextToken().trim());
71     }
72     
73     /**
74      *
75      * @return String
76      */

77     public String JavaDoc getProducts() {
78         return null;
79     }
80
81     /**
82      * Sets the name.
83      * @param name The name to set
84      */

85     public void setName(String JavaDoc name) {
86         this.name = name;
87     }
88
89     
90
91     /**
92      * Returns a list of product names in the component that this depend item
93      * defines dependency on. Note: product names list is optional and may be
94      * empty.
95      * @return List of String objects.
96      */

97     public List JavaDoc getProductsList() {
98         return productNames;
99     }
100
101 }
102
Popular Tags