KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > invicta > api > InvictaComponent


1 package net.sf.invicta.api;
2  
3 import java.util.List JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import net.sf.invicta.project.InvictaProjectException;
7
8
9 /**
10  * An interface of a component defined in a project definition files.
11  * Contains only read-only information.
12  */

13 public interface InvictaComponent extends Comparable JavaDoc {
14
15     // ************************************************************
16
// Type related methods
17
// ************************************************************
18

19     /**
20      * Returns the name of the type of this component ('JAR' for example).
21      *
22      * @return String. The type name.
23      */

24     public String JavaDoc getTypeName();
25         
26     /**
27      * Returns the full ANT template code of this component.
28      *
29      * @return String. ANT template code.
30      */

31     public String JavaDoc getTemplate();
32                     
33     /**
34      * Returns a map of the properties defined for this component (according
35      * to the type definition of this component).
36      * @return Map: Key=String (property name), Value=DefinedProperty
37      */

38     public Map JavaDoc getDefinedPropertiesMap();
39
40     /**
41      * Returns a list of the properties defined for this component (according
42      * to the type definition of this component).
43      * @return List of DefinedProperty objects.
44      */

45     public List JavaDoc getDefinedProperties();
46
47     /**
48      * Returns a property with the given name that is defined for this
49      * component.
50      * @param propertyName
51      * @return DefinedProperty. null if no property with the given name is defined.
52      */

53     public DefinedProperty getDefinedProperty(String JavaDoc propertyName);
54     
55     /**
56      * Returns the name of the initialization target (target template) of
57      * this component. For example: 'init'.
58      * @return String. Initialization target.
59      */

60     public String JavaDoc getInitTarget();
61
62     /**
63      * Returns the name of the building target (target template) of
64      * this component. For example: 'build'.
65      * @return String. Building target.
66      */

67     public String JavaDoc getBuildTarget();
68
69     /**
70      * Returns the name of the distribution target (target template) of
71      * this component. For example: 'dist'
72      * @return String. Distribution target.
73      */

74     public String JavaDoc getDistTarget();
75
76     /**
77      * Returns the name of the cleaning target (target template) of
78      * this component. For example: 'clean'.
79      * @return String. Initialization target.
80      */

81     public String JavaDoc getCleanTarget();
82
83     /**
84      * Returns whether a target with the given name is defined for this
85      * component.
86      *
87      * @param targetName
88      * @return boolean. true if a target is defined.
89      */

90     public boolean containsTarget(String JavaDoc targetName);
91
92     /**
93      * Returns a map of the targets (target templates) of this component.
94      * @return Map: Key=String (target name), Value=Target
95      */

96     public Map JavaDoc getTargetMap();
97
98     /**
99      * Returns a list of targets (target templates) of this component.
100      * @return List of Target objects.
101      */

102     public List JavaDoc getTargetList();
103
104     
105     // ************************************************************
106
// Component related methods
107
// ************************************************************
108

109
110     /**
111      * Returns the projec that this component is part of.
112      * @return InvictaProject
113      */

114     public InvictaProject getProject();
115
116     /**
117      * Returns the name of this component.
118      *
119      * @return String. Component name.
120      */

121     public String JavaDoc getName();
122     
123     
124     /**
125      * Returns the relative directory of this component.
126      *
127      * @return String. Relative directory.
128      */

129     public String JavaDoc getDir();
130         
131     /**
132      * Returns a list of component names that this component depends on
133      * (directly).
134      *
135      * @return List of String objects.
136      */

137     public List JavaDoc getDependComponentNames();
138     
139     /**
140      * Returns a list of components that this component depends on (directly).
141      *
142      * @return List of InvictaComponent objects.
143      */

144     public List JavaDoc getDependComponents();
145     
146     /**
147      * Returns a list of components that this componen depends on recursively
148      * (directly of indirectly).
149      *
150      * @return List of InvictaComponent objects.
151      */

152     public List JavaDoc getRecursiveDependComponents();
153     
154     /**
155      * Returns the products that this component requires
156      * (for compilation. private and exported without self products).
157      *
158      * @return ProductContainer
159      */

160     public ProductContainer getProductsWithoutSelf();
161     
162     /**
163      * Returns the products that this components requires or defines
164      * (private, exported and self products).
165      *
166      * @return ProductContainer
167      */

168     public ProductContainer getProducts();
169     
170     
171     /**
172      * Returns the products that this components depends on recursively
173      * (directly and indirectly, exported and non-exported by dependent components,
174      * also includes self products).
175      *
176      * @return ProductContainer
177      */

178     public ProductContainer getRecursiveProducts();
179     
180     /**
181      * Returns the products that this components depends on recursively
182      * (directly and indirectly, exported and non-exported by dependent components,
183      * doesn't include self products).
184      *
185      * @return ProductContainer
186      */

187     public ProductContainer getRecursiveProductsWithoutSelf();
188     
189     /**
190      * Returns the products that this components depends on and are exported.
191      *
192      * @return ProductContainer
193      */

194     public ProductContainer getExportedProducts();
195     
196     /**
197      * Returns the products that the product with the given defined name
198      * depends on recursively (directly and indirectly, exported and non-exported).
199      *
200      * @param productName
201      * @return ProductContainer
202      * @throws InvictaProjectException
203      */

204     public ProductContainer getRecursiveSelfProducts(String JavaDoc productName) throws InvictaProjectException;
205     
206     /**
207      * Returns the products that are defined in this component.
208      *
209      * @return ProductContainer
210      */

211     public ProductContainer getSelfProducts();
212     
213     /**
214      * Returns the products with the given name that are defined in this component
215      *
216      * @param productName
217      * @return ProductContainer
218      */

219     public ProductContainer getSelfProducts(String JavaDoc productName);
220     
221     /**
222      * Returns a product with the given type and name.
223      * Returns null if a matching product doesn't exist.
224      *
225      * @param type Optional. Ignored if null.
226      * @param name Optional. Ignored if null.
227      * @return Product
228      */

229     public Product getSelfProduct(String JavaDoc type, String JavaDoc name);
230     
231                 
232     /**
233      * Returns the value of a property (component, project or general) with
234      * the given name.
235      * Returns null if the property is not defined.
236      *
237      * @param propertyName
238      * @return String
239      */

240     public String JavaDoc getPropertyValue(String JavaDoc propertyName);
241     
242     /**
243      * Returns the a reference (ANT property reference) to the value of a
244      * property (component, project or general) with the given name.
245      * Returns null if the property is not defined.
246      *
247      * @param propertyName
248      * @return String. For example: ${sample.utils.src.dir}
249      */

250     public String JavaDoc getPropertyReferenceValue(String JavaDoc propertyName);
251             
252     /**
253      * Returns a list of depend items of dependencies of this component.
254      *
255      * @return List of DependItem objects.
256      */

257     public List JavaDoc getDependItems();
258
259     /**
260      * Returns a value of a property specifically defined in this component's definition.
261      * @param string
262      * @return Sting
263      */

264     public String JavaDoc getComponentPropertyValue(String JavaDoc string);
265             
266 }
267
Popular Tags