KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > ModuleDescriptor


1 /*
2  * This file is subject to the license found in LICENCE.TXT in the root directory of the project.
3  *
4  * #SNAPSHOT#
5  */

6 package fr.jayasoft.ivy;
7
8 import java.io.File JavaDoc;
9 import java.io.IOException JavaDoc;
10 import java.text.ParseException JavaDoc;
11 import java.util.Date JavaDoc;
12
13 import fr.jayasoft.ivy.extendable.ExtendableItem;
14 import fr.jayasoft.ivy.parser.ModuleDescriptorParser;
15 import fr.jayasoft.ivy.repository.Resource;
16 import fr.jayasoft.ivy.version.VersionMatcher;
17
18 /**
19  * @author x.hanin
20  *
21  */

22 public interface ModuleDescriptor extends ExtendableItem {
23     public static final String JavaDoc DEFAULT_CONFIGURATION = "default";
24     public static final String JavaDoc CALLER_ALL_CONFIGURATION = "all";
25     /**
26      * Returns true if this descriptor is a default one, i.e.
27      * one generated for a module not actually having one.
28      * @return
29      */

30     boolean isDefault();
31     ModuleRevisionId getModuleRevisionId();
32     /**
33      * The module revision id returned here is the resolved one,
34      * i.e. it is never a latest one. If the revision has not been
35      * resolved, a null revision should be returned by getRevision()
36      * of the returned ModuleRevisionId.
37      * This revision must be the same as the module descriptor resolved
38      * revision id unless no module descriptor is defined
39      * @return
40      */

41     ModuleRevisionId getResolvedModuleRevisionId();
42     /**
43      * This method update the resolved module revision id
44      * @param revId
45      */

46     void setResolvedModuleRevisionId(ModuleRevisionId revId);
47     /**
48      * This method update the resolved publication date
49      * @param publicationDate
50      */

51     void setResolvedPublicationDate(Date JavaDoc publicationDate);
52     
53     String JavaDoc getStatus();
54     /**
55      * may be null if unknown in the descriptor itself
56      * @return
57      */

58     Date JavaDoc getPublicationDate();
59     /**
60      * the publication date of the module revision should be the date at which it has been published,
61      * i.e. in general the date of any of its published artifacts, since all published artifact
62      * of a module should follow the same publishing cycle.
63      */

64     Date JavaDoc getResolvedPublicationDate();
65     /**
66      * Returns all the configurations declared by this module as an array.
67      * This array is never empty (a 'default' conf is assumed when none is declared
68      * in the ivy file)
69      * @return all the configurations declared by this module as an array.
70      */

71     Configuration[] getConfigurations();
72     String JavaDoc[] getConfigurationsNames();
73     String JavaDoc[] getPublicConfigurationsNames();
74     Artifact[] getArtifacts(String JavaDoc conf);
75     Artifact[] getAllArtifacts();
76     DependencyDescriptor[] getDependencies();
77     
78     /**
79      * Returns true if the module described by this descriptor dependes directly upon the
80      * given module descriptor
81      * @param md
82      * @return
83      */

84     boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md);
85     /**
86      * @param confName
87      * @return
88      */

89     Configuration getConfiguration(String JavaDoc confName);
90     
91     /**
92      * Returns the conflict manager to use for the given ModuleId
93      *
94      * @param id
95      * @return
96      */

97     ConflictManager getConflictManager(ModuleId id);
98
99     /**
100      * Returns the licenses of the module described by this descriptor
101      * @return
102      */

103     License[] getLicenses();
104     
105     String JavaDoc getHomePage();
106     long getLastModified();
107     
108     /**
109      * Writes this module descriptor as an ivy file.
110      *
111      * If this descriptor was obtained through the parsing of an ivy file, it should
112      * keep the layout of the file the most possible similar to the original one.
113      * @param ivyFile the destination ivy file
114      */

115     void toIvyFile(File JavaDoc ivyFile) throws ParseException JavaDoc, IOException JavaDoc;
116     /**
117      * The ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.
118      * @return
119      */

120     ModuleDescriptorParser getParser();
121     /**
122      * The resource being the source of this module descriptor, null if no resource corresponds to this module descriptor
123      * @return
124      */

125     Resource getResource();
126 }
127
Popular Tags