public class DefaultModuleDescriptor extends java.lang.Object implements ModuleDescriptor
CALLER_ALL_CONFIGURATION, DEFAULT_CONFIGURATION| Constructor and Description |
|---|
DefaultModuleDescriptor(ModuleDescriptorParser parser,
Resource res)
IMPORTANT : at least call setModuleRevisionId and setResolvedPublicationDate with instances
created by this constructor !
|
DefaultModuleDescriptor(ModuleRevisionId id,
java.lang.String status,
java.util.Date pubDate) |
DefaultModuleDescriptor(ModuleRevisionId id,
java.lang.String status,
java.util.Date pubDate,
boolean isDefault) |
| Modifier and Type | Method and Description |
|---|---|
void |
addArtifact(java.lang.String conf,
Artifact artifact)
Artifact configurations are not used since added artifact may not be entirely completed, so
its configurations data may not be accurate
|
void |
addConfiguration(Configuration conf) |
void |
addConflictManager(ModuleId moduleId,
PatternMatcher matcher,
ConflictManager manager)
regular expressions as explained in Pattern class may be used in ModuleId organisation and
name
|
void |
addDependency(DependencyDescriptor dependency) |
void |
addDependencyDescriptorMediator(ModuleId moduleId,
PatternMatcher matcher,
DependencyDescriptorMediator ddm) |
void |
addExcludeRule(ExcludeRule rule) |
void |
addExtraAttributeNamespace(java.lang.String prefix,
java.lang.String namespace) |
void |
addExtraInfo(ExtraInfoHolder extraInfo) |
void |
addExtraInfo(java.lang.String infoKey,
java.lang.String value)
Deprecated.
|
void |
addInheritedDescriptor(ExtendsDescriptor descriptor) |
void |
addLicense(License license) |
boolean |
canExclude() |
void |
check()
Throws an exception if the module descriptor is inconsistent.
|
boolean |
dependsOn(VersionMatcher matcher,
ModuleDescriptor md) |
boolean |
doesExclude(java.lang.String[] moduleConfigurations,
ArtifactId artifactId)
Only works when namespace is properly set.
|
boolean |
equals(java.lang.Object obj) |
Artifact[] |
getAllArtifacts() |
ModuleRules<DependencyDescriptorMediator> |
getAllDependencyDescriptorMediators() |
ExcludeRule[] |
getAllExcludeRules()
Module Descriptor exclude rules are used to exclude (usually transitive) dependencies for the
whole module.
|
Artifact[] |
getArtifacts(java.lang.String conf) |
java.lang.String |
getAttribute(java.lang.String attName)
Gets the value of an attribute Can be used to access the value of a standard attribute (like
organisation, revision) or of an extra attribute.
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a Map of all attributes of this extendable item, including standard and extra ones.
|
Configuration |
getConfiguration(java.lang.String confName) |
Configuration[] |
getConfigurations() |
java.lang.String[] |
getConfigurationsNames() |
ConflictManager |
getConflictManager(ModuleId moduleId) |
java.lang.String |
getDefaultConf() |
java.lang.String |
getDefaultConfMapping() |
DependencyDescriptor[] |
getDependencies() |
java.lang.String |
getDescription() |
ExcludeRule[] |
getExcludeRules(java.lang.String[] moduleConfigurations) |
java.lang.String |
getExtraAttribute(java.lang.String attName)
Gets the value of an extra attribute Can be used only to access the value of an extra
attribute, not a standard one (like organisation, revision)
|
java.util.Map<java.lang.String,java.lang.String> |
getExtraAttributes()
Returns a Map of all extra attributes of this extendable item.
|
java.util.Map<java.lang.String,java.lang.String> |
getExtraAttributesNamespaces() |
java.util.Map<java.lang.String,java.lang.String> |
getExtraInfo()
Deprecated.
|
ExtraInfoHolder |
getExtraInfoByTagName(java.lang.String tagName) |
java.lang.String |
getExtraInfoContentByTagName(java.lang.String tagName) |
java.util.List<ExtraInfoHolder> |
getExtraInfos() |
java.lang.String |
getHomePage() |
ExtendsDescriptor[] |
getInheritedDescriptors() |
long |
getLastModified() |
License[] |
getLicenses() |
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.
|
ModuleRevisionId |
getModuleRevisionId() |
Namespace |
getNamespace() |
ModuleDescriptorParser |
getParser() |
java.util.Date |
getPublicationDate() |
java.lang.String[] |
getPublicConfigurationsNames() |
java.util.Map<java.lang.String,java.lang.String> |
getQualifiedExtraAttributes()
Returns a Map of all extra attributes of this extendable item.
|
ModuleRevisionId |
getResolvedModuleRevisionId() |
java.util.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.
|
Resource |
getResource() |
java.lang.String |
getRevision() |
java.lang.String |
getStatus() |
int |
hashCode() |
boolean |
isDefault() |
boolean |
isMappingOverride() |
boolean |
isNamespaceUseful() |
DependencyDescriptor |
mediate(DependencyDescriptor dd)
Mediates the given
DependencyDescriptor according to this ModuleDescriptor. |
static DefaultModuleDescriptor |
newBasicInstance(ModuleRevisionId mrid,
java.util.Date publicationDate) |
static DefaultModuleDescriptor |
newCallerInstance(ModuleRevisionId[] mrids,
boolean transitive,
boolean changing) |
static DefaultModuleDescriptor |
newCallerInstance(ModuleRevisionId mrid,
java.lang.String[] confs,
boolean transitive,
boolean changing) |
static DefaultModuleDescriptor |
newDefaultInstance(ModuleRevisionId mrid) |
static DefaultModuleDescriptor |
newDefaultInstance(ModuleRevisionId mrid,
DependencyArtifactDescriptor[] artifacts) |
void |
setDefault(boolean b) |
void |
setDefaultConf(java.lang.String defaultConf) |
void |
setDefaultConfMapping(java.lang.String defaultConfMapping) |
void |
setDescription(java.lang.String description) |
void |
setHomePage(java.lang.String homePage) |
void |
setLastModified(long lastModified) |
void |
setMappingOverride(boolean override) |
void |
setModuleArtifact(Artifact moduleArtifact) |
void |
setModuleRevisionId(ModuleRevisionId revId) |
void |
setNamespace(Namespace ns) |
void |
setPublicationDate(java.util.Date publicationDate) |
void |
setResolvedModuleRevisionId(ModuleRevisionId revId)
This method updates the resolved module revision id
|
void |
setResolvedPublicationDate(java.util.Date publicationDate)
This method update the resolved publication date
|
void |
setStatus(java.lang.String status) |
void |
toIvyFile(java.io.File destFile)
Writes this module descriptor as an ivy file.
|
java.lang.String |
toString() |
static ModuleDescriptor |
transformInstance(ModuleDescriptor md,
Namespace ns)
Transforms the given module descriptor of the given namespace and return a new module
descriptor in the system namespace.
|
public DefaultModuleDescriptor(ModuleRevisionId id, java.lang.String status, java.util.Date pubDate)
public DefaultModuleDescriptor(ModuleRevisionId id, java.lang.String status, java.util.Date pubDate, boolean isDefault)
public DefaultModuleDescriptor(ModuleDescriptorParser parser, Resource res)
parser - ModuleDescriptorParserres - Resourcepublic static DefaultModuleDescriptor newDefaultInstance(ModuleRevisionId mrid)
public static DefaultModuleDescriptor newCallerInstance(ModuleRevisionId mrid, java.lang.String[] confs, boolean transitive, boolean changing)
public static DefaultModuleDescriptor newCallerInstance(ModuleRevisionId[] mrids, boolean transitive, boolean changing)
public static DefaultModuleDescriptor newDefaultInstance(ModuleRevisionId mrid, DependencyArtifactDescriptor[] artifacts)
public static DefaultModuleDescriptor newBasicInstance(ModuleRevisionId mrid, java.util.Date publicationDate)
public static ModuleDescriptor transformInstance(ModuleDescriptor md, Namespace ns)
md - ModuleDescriptorns - Namespacepublic Artifact getMetadataArtifact()
ModuleDescriptorgetMetadataArtifact in interface ModuleDescriptorpublic void setModuleArtifact(Artifact moduleArtifact)
public boolean isDefault()
isDefault in interface ModuleDescriptorpublic void setPublicationDate(java.util.Date publicationDate)
public java.util.Date getPublicationDate()
getPublicationDate in interface ModuleDescriptorpublic void setResolvedPublicationDate(java.util.Date publicationDate)
ModuleDescriptorsetResolvedPublicationDate in interface ModuleDescriptorpublicationDate - Datepublic java.util.Date getResolvedPublicationDate()
ModuleDescriptorgetResolvedPublicationDate in interface ModuleDescriptorpublic java.lang.String getRevision()
getRevision in interface ArtifactInfopublic void setModuleRevisionId(ModuleRevisionId revId)
public void setResolvedModuleRevisionId(ModuleRevisionId revId)
ModuleDescriptorsetResolvedModuleRevisionId in interface ModuleDescriptorrevId - ModuleRevisionIdpublic void setStatus(java.lang.String status)
public void addInheritedDescriptor(ExtendsDescriptor descriptor)
public void addDependency(DependencyDescriptor dependency)
public void addConfiguration(Configuration conf)
public void addArtifact(java.lang.String conf,
Artifact artifact)
conf - dittoartifact - dittopublic ModuleRevisionId getModuleRevisionId()
getModuleRevisionId in interface ModuleDescriptorpublic ModuleRevisionId getResolvedModuleRevisionId()
getResolvedModuleRevisionId in interface ModuleDescriptorpublic java.lang.String getStatus()
getStatus in interface ModuleDescriptorpublic ExtendsDescriptor[] getInheritedDescriptors()
getInheritedDescriptors in interface ModuleDescriptorpublic Configuration[] getConfigurations()
getConfigurations in interface ModuleDescriptorpublic java.lang.String[] getConfigurationsNames()
getConfigurationsNames in interface ModuleDescriptorpublic java.lang.String[] getPublicConfigurationsNames()
getPublicConfigurationsNames in interface ModuleDescriptorpublic Configuration getConfiguration(java.lang.String confName)
getConfiguration in interface ModuleDescriptorconfName - Stringpublic Artifact[] getArtifacts(java.lang.String conf)
getArtifacts in interface ModuleDescriptorpublic Artifact[] getAllArtifacts()
getAllArtifacts in interface ModuleDescriptorModuleDescriptor.getMetadataArtifact()public DependencyDescriptor[] getDependencies()
getDependencies in interface ModuleDescriptorpublic boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md)
dependsOn in interface ModuleDescriptormatcher - VersionMatchermd - ModuleDescriptorpublic void toIvyFile(java.io.File destFile)
throws java.text.ParseException,
java.io.IOException
ModuleDescriptortoIvyFile in interface ModuleDescriptordestFile - the destination ivy filejava.text.ParseException - if something goes wrongjava.io.IOException - if something goes wrongpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setDefault(boolean b)
public void addConflictManager(ModuleId moduleId, PatternMatcher matcher, ConflictManager manager)
moduleId - dittomatcher - PatternMatchermanager - ConflictManagerpublic ConflictManager getConflictManager(ModuleId moduleId)
getConflictManager in interface ModuleDescriptormoduleId - ModuleIdpublic void addDependencyDescriptorMediator(ModuleId moduleId, PatternMatcher matcher, DependencyDescriptorMediator ddm)
public DependencyDescriptor mediate(DependencyDescriptor dd)
DependencyDescriptorMediatorDependencyDescriptor according to this ModuleDescriptor.
This method gives the opportunity to a ModuleDescriptor to override dependency version information of any of its transitive dependencies, since it is called by dependency resolvers before actually resolving a dependency.
mediate in interface DependencyDescriptorMediatordd - the dependency descriptor which should be mediated.DependencyDescriptor, or the original
DependencyDescriptor if no mediation is required by this ModuleDescriptor.public ModuleRules<DependencyDescriptorMediator> getAllDependencyDescriptorMediators()
getAllDependencyDescriptorMediators in interface ModuleDescriptorDependencyDescriptorMediators used by this
ModuleDescriptor, as an instance of ModuleRules.public void addLicense(License license)
public License[] getLicenses()
getLicenses in interface ModuleDescriptorpublic java.lang.String getHomePage()
getHomePage in interface ModuleDescriptorpublic void setHomePage(java.lang.String homePage)
public java.lang.String getDescription()
getDescription in interface ModuleDescriptorpublic void setDescription(java.lang.String description)
public long getLastModified()
getLastModified in interface ModuleDescriptorgetLastModified in interface ArtifactInfopublic void setLastModified(long lastModified)
public Namespace getNamespace()
public boolean isNamespaceUseful()
public void setNamespace(Namespace ns)
public void check()
public java.lang.String getDefaultConf()
public void setDefaultConf(java.lang.String defaultConf)
public java.lang.String getDefaultConfMapping()
public void setDefaultConfMapping(java.lang.String defaultConfMapping)
public void setMappingOverride(boolean override)
public boolean isMappingOverride()
public java.lang.String getAttribute(java.lang.String attName)
ExtendableItemgetAttribute in interface ExtendableItemattName - the name of the attribute to getpublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
ExtendableItemgetAttributes in interface ExtendableItempublic java.lang.String getExtraAttribute(java.lang.String attName)
ExtendableItemgetExtraAttribute in interface ExtendableItemattName - the name of the extra attribute to get. This name can be either qualified or
unqualified.public java.util.Map<java.lang.String,java.lang.String> getExtraAttributes()
ExtendableItemgetExtraAttributes in interface ExtendableItemExtendableItem.getQualifiedExtraAttributes()public java.util.Map<java.lang.String,java.lang.String> getQualifiedExtraAttributes()
ExtendableItemThe Map keys are qualified attribute names as Strings, and values are corresponding attribute values (as String too).
An attribute name is qualified with a namespace exactly the same way xml attributes are
qualified. Thus qualified attribute names are of the form prefix:name
getQualifiedExtraAttributes in interface ExtendableItemExtendableItem.getExtraAttributes()public ModuleDescriptorParser getParser()
getParser in interface ModuleDescriptorpublic Resource getResource()
getResource in interface ModuleDescriptorpublic void addExcludeRule(ExcludeRule rule)
public boolean canExclude()
canExclude in interface ModuleDescriptorpublic boolean doesExclude(java.lang.String[] moduleConfigurations,
ArtifactId artifactId)
doesExclude in interface ModuleDescriptormoduleConfigurations - String[]artifactId - dittopublic ExcludeRule[] getAllExcludeRules()
ModuleDescriptorgetAllExcludeRules in interface ModuleDescriptorExcludeRule this module descriptor currently holds.public ExcludeRule[] getExcludeRules(java.lang.String[] moduleConfigurations)
public java.util.Map<java.lang.String,java.lang.String> getExtraAttributesNamespaces()
getExtraAttributesNamespaces in interface ModuleDescriptorpublic void addExtraAttributeNamespace(java.lang.String prefix,
java.lang.String namespace)
@Deprecated
public void addExtraInfo(java.lang.String infoKey,
java.lang.String value)
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getExtraInfo()
getExtraInfo in interface ModuleDescriptorpublic java.util.List<ExtraInfoHolder> getExtraInfos()
getExtraInfos in interface ModuleDescriptorpublic void addExtraInfo(ExtraInfoHolder extraInfo)
public java.lang.String getExtraInfoContentByTagName(java.lang.String tagName)
getExtraInfoContentByTagName in interface ModuleDescriptortagName - Stringpublic ExtraInfoHolder getExtraInfoByTagName(java.lang.String tagName)
getExtraInfoByTagName in interface ModuleDescriptortagName - StringCopyright ©2007-2022 The Apache Software Foundation, Licensed under Apache License, Version 2.0.