Interface ModuleDescriptor
- All Superinterfaces:
ArtifactInfo
,DependencyDescriptorMediator
,ExtendableItem
- All Known Subinterfaces:
WorkspaceModuleDescriptor
- All Known Implementing Classes:
DefaultModuleDescriptor
,DefaultWorkspaceModuleDescriptor
,PomModuleDescriptorBuilder.PomModuleDescriptor
public interface ModuleDescriptor
extends ExtendableItem, ArtifactInfo, DependencyDescriptorMediator
Descriptor of a module. This is the Java representation of an ivy.xml
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
dependsOn
(VersionMatcher matcher, ModuleDescriptor md) boolean
doesExclude
(String[] moduleConfs, ArtifactId artifactId) Artifact[]
Module Descriptor exclude rules are used to exclude (usually transitive) dependencies for the whole module.Artifact[]
getArtifacts
(String conf) getConfiguration
(String confName) String[]
Deprecated.this method is not returning the full content of the extra info: to get the full structure of the extra infos, use getExtraInfos()getExtraInfoByTagName
(String tagName) getExtraInfoContentByTagName
(String tagName) long
License[]
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.String[]
The publication date of the module revision should be the date at which it has been published, i.e.boolean
void
This method updates the resolved module revision idvoid
setResolvedPublicationDate
(Date publicationDate) This method update the resolved publication datevoid
Writes this module descriptor as an ivy file.Methods inherited from interface org.apache.ivy.plugins.latest.ArtifactInfo
getRevision
Methods inherited from interface org.apache.ivy.core.module.descriptor.DependencyDescriptorMediator
mediate
Methods inherited from interface org.apache.ivy.util.extendable.ExtendableItem
getAttribute, getAttributes, getExtraAttribute, getExtraAttributes, getQualifiedExtraAttributes
-
Field Details
-
DEFAULT_CONFIGURATION
- See Also:
-
CALLER_ALL_CONFIGURATION
- See Also:
-
-
Method Details
-
isDefault
boolean isDefault()- Returns:
- true if this descriptor is a default one, i.e. one generated for a module not actually having one.
-
getModuleRevisionId
ModuleRevisionId getModuleRevisionId() -
getResolvedModuleRevisionId
ModuleRevisionId getResolvedModuleRevisionId()- Returns:
- the resolved module revision id; it is never the 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
-
setResolvedModuleRevisionId
This method updates the resolved module revision id- Parameters:
revId
- ModuleRevisionId
-
getInheritedDescriptors
ExtendsDescriptor[] getInheritedDescriptors()- Returns:
- the list of parent descriptors imported via an <extends> element. Only directly imported descriptors are included; the parent's parents are not included.
-
setResolvedPublicationDate
This method update the resolved publication date- Parameters:
publicationDate
- Date
-
getStatus
String getStatus() -
getPublicationDate
Date getPublicationDate()- Returns:
- the publication date or null when not known in the descriptor itself.
-
getResolvedPublicationDate
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.- Returns:
- Date
-
getConfigurations
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).
-
getConfigurationsNames
String[] getConfigurationsNames() -
getPublicConfigurationsNames
String[] getPublicConfigurationsNames() -
getArtifacts
-
getAllArtifacts
Artifact[] getAllArtifacts()- Returns:
- all published artifacts of this module, excluding the artifact corresponding to the module descriptor.
- See Also:
-
getDependencies
DependencyDescriptor[] getDependencies()- Returns:
- The dependencies of the module. If there are no dependencies return an empty array (non null)
-
dependsOn
- Parameters:
matcher
- VersionMatchermd
- ModuleDescriptor- Returns:
- true if the module described by this descriptor depends directly upon the given module descriptor
-
getConfiguration
- Parameters:
confName
- ditto- Returns:
- Configuration
-
getConflictManager
- Parameters:
id
- ModuleId- 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.
-
getLicenses
License[] getLicenses()- Returns:
- the licenses of the module described by this descriptor
-
getHomePage
String getHomePage() -
getDescription
String getDescription() -
getLastModified
long getLastModified()- Specified by:
getLastModified
in interfaceArtifactInfo
-
toIvyFile
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- Throws:
ParseException
- if something goes wrongIOException
- if something goes wrong
-
getParser
ModuleDescriptorParser getParser()- Returns:
- the ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.
-
getResource
Resource getResource()- Returns:
- the resource being the source of this module descriptor, null if no resource corresponds to this module descriptor.
-
getMetadataArtifact
Artifact getMetadataArtifact()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.
-
canExclude
boolean canExclude()- Returns:
- true if this descriptor contains any exclusion rule.
-
doesExclude
- Parameters:
moduleConfs
- String[]artifactId
- ditto- 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
-
getAllExcludeRules
ExcludeRule[] getAllExcludeRules()Module Descriptor exclude rules are used to exclude (usually transitive) dependencies for the whole module.- Returns:
- an array of all
ExcludeRule
this module descriptor currently holds.
-
getAllDependencyDescriptorMediators
ModuleRules<DependencyDescriptorMediator> getAllDependencyDescriptorMediators()- Returns:
- all the
DependencyDescriptorMediator
s used by thisModuleDescriptor
, as an instance ofModuleRules
.
-
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
-
getExtraInfo
Deprecated.this method is not returning the full content of the extra info: to get the full structure of the extra infos, use getExtraInfos()- 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.
-
getExtraInfos
List<ExtraInfoHolder> getExtraInfos()- Returns:
- a list of extras infos (tag name, attributes and content). All the tags except the description are given.
- Since:
- 2.4.0
-
getExtraInfoContentByTagName
- Parameters:
tagName
- String- Returns:
- content from first extrainfo matching with given tag name.
- Since:
- 2.4.0
-
getExtraInfoByTagName
- Parameters:
tagName
- String- Returns:
- first extrainfo matching with given tag name.
- Since:
- 2.4.0
-