org.apache.ivy.core.module.descriptor

Interface ModuleDescriptor

public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, DependencyDescriptorMediator

Decriptor of a module. This is the Java representation of an ivy.xml
Field Summary
static StringCALLER_ALL_CONFIGURATION
static StringDEFAULT_CONFIGURATION
Method Summary
booleancanExclude()
Returns true if this descriptor contains any exclusion rule
booleandependsOn(VersionMatcher matcher, ModuleDescriptor md)
Returns true if the module described by this descriptor dependes directly upon the given module descriptor
booleandoesExclude(String[] moduleConfs, ArtifactId artifactId)
Returns true if an exclude rule of this module attached to any of the given configurations matches the given artifact id, and thus exclude it
Artifact[]getAllArtifacts()
Returns all artifacts of this module, excluding the artifact corresponding to the module descriptor.
ModuleRulesgetAllDependencyDescriptorMediators()
Returns all the dependency descriptor mediators used by this ModuleDescriptor, as an instance of ModuleRules.
ExcludeRule[]getAllExcludeRules()
Returns an array of all the exclude rules this module descriptor currently holds.
Artifact[]getArtifacts(String conf)
ConfigurationgetConfiguration(String confName)
Configuration[]getConfigurations()
Returns all the configurations declared by this module as an array.
String[]getConfigurationsNames()
ConflictManagergetConflictManager(ModuleId id)
Returns the conflict manager to use for the given ModuleId, or null if no specific conflict manager is associated with the given module id in this module descriptor.
DependencyDescriptor[]getDependencies()
StringgetDescription()
MapgetExtraAttributesNamespaces()
Returns the list of xml namespaces used by extra attributes, as Map from prefix to namespace URIs.
MapgetExtraInfo()
Returns the custom info provided in the info tag.
StringgetHomePage()
longgetLastModified()
License[]getLicenses()
Returns the licenses of the module described by this descriptor
ArtifactgetMetadataArtifact()
Returns the Artifact representing this module descriptor itself.
ModuleRevisionIdgetModuleRevisionId()
ModuleDescriptorParsergetParser()
The ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.
DategetPublicationDate()
May be null if unknown in the descriptor itself.
String[]getPublicConfigurationsNames()
ModuleRevisionIdgetResolvedModuleRevisionId()
The module revision id returned here is the resolved one, i.e. it is never a latest one.
DategetResolvedPublicationDate()
The publication date of the module revision should be the date at which it has been published, i.e. in general the date of any of its published artifacts, since all published artifact of a module should follow the same publishing cycle.
ResourcegetResource()
The resource being the source of this module descriptor, null if no resource corresponds to this module descriptor
StringgetStatus()
booleanisDefault()
Returns true if this descriptor is a default one, i.e. one generated for a module not actually having one.
voidsetResolvedModuleRevisionId(ModuleRevisionId revId)
This method update the resolved module revision id
voidsetResolvedPublicationDate(Date publicationDate)
This method update the resolved publication date
voidtoIvyFile(File ivyFile)
Writes this module descriptor as an ivy file.

Field Detail

CALLER_ALL_CONFIGURATION

public static final String CALLER_ALL_CONFIGURATION

DEFAULT_CONFIGURATION

public static final String DEFAULT_CONFIGURATION

Method Detail

canExclude

public boolean canExclude()
Returns true if this descriptor contains any exclusion rule

Returns: true if this descriptor contains any exclusion rule

dependsOn

public boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md)
Returns true if the module described by this descriptor dependes directly upon the given module descriptor

Parameters: md

Returns:

doesExclude

public boolean doesExclude(String[] moduleConfs, ArtifactId artifactId)
Returns true if an exclude rule of this module attached to any of the given configurations matches the given artifact id, and thus exclude it

Parameters: moduleConfs artifactId

Returns:

getAllArtifacts

public Artifact[] getAllArtifacts()
Returns all artifacts of this module, excluding the artifact corresponding to the module descriptor.

Returns: all published artifacts of this module

See Also: getMetadataArtifact

getAllDependencyDescriptorMediators

public ModuleRules getAllDependencyDescriptorMediators()
Returns all the dependency descriptor mediators used by this ModuleDescriptor, as an instance of ModuleRules.

All rules in the ModuleRules object returned are DependencyDescriptorMediator.

Returns: all the dependency descriptor mediators used by this ModuleDescriptor.

getAllExcludeRules

public ExcludeRule[] getAllExcludeRules()
Returns an array of all the exclude rules this module descriptor currently holds. Module Descriptor exclude rules are used to exclude (usually transitive) dependencies for the whole module.

Returns: an array of ExcludeRule this module descriptor holds

getArtifacts

public Artifact[] getArtifacts(String conf)

getConfiguration

public Configuration getConfiguration(String confName)

Parameters: confName

Returns:

getConfigurations

public Configuration[] getConfigurations()
Returns all the configurations declared by this module as an array. This array is never empty (a 'default' conf is assumed when none is declared in the ivy file)

Returns: all the configurations declared by this module as an array.

getConfigurationsNames

public String[] getConfigurationsNames()

getConflictManager

public ConflictManager getConflictManager(ModuleId id)
Returns the conflict manager to use for the given ModuleId, or null if no specific conflict manager is associated with the given module id in this module descriptor.

Parameters: id

Returns:

getDependencies

public DependencyDescriptor[] getDependencies()

UNKNOWN: The dependencies of the module. If there is no dependencies return an empty array (non null)

getDescription

public String getDescription()

getExtraAttributesNamespaces

public Map getExtraAttributesNamespaces()
Returns the list of xml namespaces used by extra attributes, as Map from prefix to namespace URIs.

The returned list is never null, it is empty when no extra attribute is used or if extra attributes are used without xml namespaces

Returns: the list of xml namespaces used by extra attributes, as Map from prefix to namespace URIs.

getExtraInfo

public Map getExtraInfo()
Returns the custom info provided in the info tag. All the tags except the description are given. The key is the name of the tag, the value is its content.

Returns:

getHomePage

public String getHomePage()

getLastModified

public long getLastModified()

getLicenses

public License[] getLicenses()
Returns the licenses of the module described by this descriptor

Returns:

getMetadataArtifact

public Artifact getMetadataArtifact()
Returns the Artifact representing this module descriptor itself.

Even though the module descriptor is never described as a published artifact of a module in the module descriptor itself, it is often useful to consider it as any other artifact of the module. This method allows to access to the Artifact object representing this module descriptor for this purpose.

Returns: the Artifact representing this module descriptor itself.

getModuleRevisionId

public ModuleRevisionId getModuleRevisionId()

getParser

public ModuleDescriptorParser getParser()
The ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.

Returns:

getPublicationDate

public Date getPublicationDate()
May be null if unknown in the descriptor itself.

Returns: The publication date or null when not knwon.

getPublicConfigurationsNames

public String[] getPublicConfigurationsNames()

getResolvedModuleRevisionId

public ModuleRevisionId getResolvedModuleRevisionId()
The module revision id returned here is the resolved one, i.e. it is never a latest one. If the revision has not been resolved, a null revision should be returned by getRevision() of the returned ModuleRevisionId. This revision must be the same as the module descriptor resolved revision id unless no module descriptor is defined

Returns:

getResolvedPublicationDate

public Date getResolvedPublicationDate()
The publication date of the module revision should be the date at which it has been published, i.e. in general the date of any of its published artifacts, since all published artifact of a module should follow the same publishing cycle.

getResource

public Resource getResource()
The resource being the source of this module descriptor, null if no resource corresponds to this module descriptor

Returns:

getStatus

public String getStatus()

isDefault

public boolean isDefault()
Returns true if this descriptor is a default one, i.e. one generated for a module not actually having one.

Returns:

setResolvedModuleRevisionId

public void setResolvedModuleRevisionId(ModuleRevisionId revId)
This method update the resolved module revision id

Parameters: revId

setResolvedPublicationDate

public void setResolvedPublicationDate(Date publicationDate)
This method update the resolved publication date

Parameters: publicationDate

toIvyFile

public void toIvyFile(File ivyFile)
Writes this module descriptor as an ivy file. If this descriptor was obtained through the parsing of an ivy file, it should keep the layout of the file the most possible similar to the original one.

Parameters: ivyFile the destination ivy file