public class DefaultDependencyDescriptor extends java.lang.Object implements DependencyDescriptor
| Constructor and Description |
|---|
DefaultDependencyDescriptor(ModuleDescriptor md,
ModuleRevisionId mrid,
boolean force,
boolean changing,
boolean transitive) |
DefaultDependencyDescriptor(ModuleDescriptor md,
ModuleRevisionId mrid,
ModuleRevisionId dynamicConstraint,
boolean force,
boolean changing,
boolean transitive) |
DefaultDependencyDescriptor(ModuleRevisionId mrid,
boolean force) |
DefaultDependencyDescriptor(ModuleRevisionId mrid,
boolean force,
boolean changing) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDependencyArtifact(java.lang.String masterConf,
DependencyArtifactDescriptor dad) |
void |
addDependencyConfiguration(java.lang.String masterConf,
java.lang.String depConf) |
void |
addExcludeRule(java.lang.String masterConf,
ExcludeRule rule) |
void |
addIncludeRule(java.lang.String masterConf,
IncludeRule rule) |
DependencyDescriptor |
asSystem() |
boolean |
canExclude()
Returns true if this descriptor contains any exclusion rule
|
DependencyDescriptor |
clone(ModuleRevisionId revision)
Clones current dependency descriptor with another revision.
|
boolean |
doesExclude(java.lang.String[] moduleConfigurations,
ArtifactId artifactId)
only works when namespace is properly set.
|
DependencyArtifactDescriptor[] |
getAllDependencyArtifacts() |
ExcludeRule[] |
getAllExcludeRules() |
IncludeRule[] |
getAllIncludeRules() |
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 |
getAttributes()
Returns a Map of all attributes of this extendable item, including standard and extra ones.
|
DependencyArtifactDescriptor[] |
getDependencyArtifacts(java.lang.String moduleConfiguration) |
DependencyArtifactDescriptor[] |
getDependencyArtifacts(java.lang.String[] moduleConfigurations) |
java.lang.String[] |
getDependencyConfigurations(java.lang.String moduleConfiguration) |
java.lang.String[] |
getDependencyConfigurations(java.lang.String[] moduleConfigurations) |
java.lang.String[] |
getDependencyConfigurations(java.lang.String moduleConfiguration,
java.lang.String requestedConfiguration)
Return the dependency configurations mapped to the given moduleConfiguration, actually
resolved because of the given requestedConfiguration
Usually requestedConfiguration and moduleConfiguration are the same, except when a conf
extends another, then the moduleConfiguration is the configuration currently resolved (the
extended one), and requestedConfiguration is the one actually requested initially (the
extending one).
|
ModuleId |
getDependencyId() |
ModuleRevisionId |
getDependencyRevisionId()
Returns the constraint on dependency this descriptor represents.
|
ModuleRevisionId |
getDynamicConstraintDependencyRevisionId()
Returns the dynamic constraint on dependency this descriptor represents.
|
ExcludeRule[] |
getExcludeRules(java.lang.String moduleConfiguration) |
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 |
getExtraAttributes()
Returns a Map of all extra attributes of this extendable item.
|
IncludeRule[] |
getIncludeRules(java.lang.String moduleConfiguration) |
IncludeRule[] |
getIncludeRules(java.lang.String[] moduleConfigurations) |
java.lang.String[] |
getModuleConfigurations() |
Namespace |
getNamespace() |
ModuleRevisionId |
getParentRevisionId() |
java.util.Map |
getQualifiedExtraAttributes()
Returns a Map of all extra attributes of this extendable item.
|
ModuleRevisionId |
getSourceModule() |
boolean |
isChanging()
Used to indicate that this dependency is a changing one.
|
boolean |
isForce()
Used to indicate that this revision must be used in case of conflicts, independently of
conflicts manager.
|
boolean |
isTransitive() |
protected static java.lang.String |
replaceFallbackConfigurationPattern(java.util.regex.Pattern pattern,
java.lang.String conf,
java.lang.String moduleConfiguration)
Replaces fallback patterns with correct values if fallback pattern exists.
|
protected static java.lang.String |
replaceSelfFallbackPattern(java.lang.String conf,
java.lang.String moduleConfiguration) |
protected static java.lang.String |
replaceThisFallbackPattern(java.lang.String conf,
java.lang.String requestedConfiguration) |
java.lang.String |
toString() |
static DependencyDescriptor |
transformInstance(DependencyDescriptor dd,
Namespace ns)
Transforms the given dependency descriptor of the given namespace and return a new dependency
descriptor in the system namespace.
|
static DefaultDependencyDescriptor |
transformInstance(DependencyDescriptor dd,
NamespaceTransformer t,
boolean fromSystem)
Transforms a dependency descriptor using the given transformer.
|
public DefaultDependencyDescriptor(ModuleDescriptor md, ModuleRevisionId mrid, boolean force, boolean changing, boolean transitive)
public DefaultDependencyDescriptor(ModuleRevisionId mrid, boolean force)
public DefaultDependencyDescriptor(ModuleRevisionId mrid, boolean force, boolean changing)
public DefaultDependencyDescriptor(ModuleDescriptor md, ModuleRevisionId mrid, ModuleRevisionId dynamicConstraint, boolean force, boolean changing, boolean transitive)
public static DependencyDescriptor transformInstance(DependencyDescriptor dd, Namespace ns)
dd - ns - public static DefaultDependencyDescriptor transformInstance(DependencyDescriptor dd, NamespaceTransformer t, boolean fromSystem)
dd - t - public ModuleId getDependencyId()
getDependencyId in interface DependencyDescriptorpublic ModuleRevisionId getDependencyRevisionId()
DependencyDescriptorgetDependencyRevisionId in interface DependencyDescriptorpublic ModuleRevisionId getDynamicConstraintDependencyRevisionId()
DependencyDescriptorgetDynamicConstraintDependencyRevisionId in interface DependencyDescriptorpublic java.lang.String[] getModuleConfigurations()
getModuleConfigurations in interface DependencyDescriptorpublic java.lang.String[] getDependencyConfigurations(java.lang.String moduleConfiguration)
getDependencyConfigurations in interface DependencyDescriptorpublic java.lang.String[] getDependencyConfigurations(java.lang.String moduleConfiguration,
java.lang.String requestedConfiguration)
Usually requestedConfiguration and moduleConfiguration are the same, except when a conf extends another, then the moduleConfiguration is the configuration currently resolved (the extended one), and requestedConfiguration is the one actually requested initially (the extending one). Both moduleConfiguration and requestedConfiguration are configurations of the caller, the array returned is composed of the required configurations of the dependency described by this descriptor.
getDependencyConfigurations in interface DependencyDescriptorprotected static java.lang.String replaceSelfFallbackPattern(java.lang.String conf,
java.lang.String moduleConfiguration)
protected static java.lang.String replaceThisFallbackPattern(java.lang.String conf,
java.lang.String requestedConfiguration)
protected static java.lang.String replaceFallbackConfigurationPattern(java.util.regex.Pattern pattern,
java.lang.String conf,
java.lang.String moduleConfiguration)
pattern - pattern to look forconf - configuration mapping from dependency elementmoduleConfiguration - module's configuration to use for replacementpublic java.lang.String[] getDependencyConfigurations(java.lang.String[] moduleConfigurations)
getDependencyConfigurations in interface DependencyDescriptorpublic DependencyArtifactDescriptor[] getDependencyArtifacts(java.lang.String moduleConfiguration)
getDependencyArtifacts in interface DependencyDescriptorpublic IncludeRule[] getIncludeRules(java.lang.String moduleConfiguration)
getIncludeRules in interface DependencyDescriptorpublic ExcludeRule[] getExcludeRules(java.lang.String moduleConfiguration)
getExcludeRules in interface DependencyDescriptorpublic DependencyArtifactDescriptor[] getDependencyArtifacts(java.lang.String[] moduleConfigurations)
getDependencyArtifacts in interface DependencyDescriptorpublic IncludeRule[] getIncludeRules(java.lang.String[] moduleConfigurations)
getIncludeRules in interface DependencyDescriptorpublic ExcludeRule[] getExcludeRules(java.lang.String[] moduleConfigurations)
getExcludeRules in interface DependencyDescriptorpublic DependencyArtifactDescriptor[] getAllDependencyArtifacts()
getAllDependencyArtifacts in interface DependencyDescriptorpublic IncludeRule[] getAllIncludeRules()
getAllIncludeRules in interface DependencyDescriptorpublic ExcludeRule[] getAllExcludeRules()
getAllExcludeRules in interface DependencyDescriptorpublic void addDependencyConfiguration(java.lang.String masterConf,
java.lang.String depConf)
public void addDependencyArtifact(java.lang.String masterConf,
DependencyArtifactDescriptor dad)
public void addIncludeRule(java.lang.String masterConf,
IncludeRule rule)
public void addExcludeRule(java.lang.String masterConf,
ExcludeRule rule)
public boolean doesExclude(java.lang.String[] moduleConfigurations,
ArtifactId artifactId)
doesExclude in interface DependencyDescriptorpublic boolean canExclude()
canExclude in interface DependencyDescriptorpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isForce()
DependencyDescriptorisForce in interface DependencyDescriptorpublic ModuleRevisionId getParentRevisionId()
getParentRevisionId in interface DependencyDescriptorpublic boolean isChanging()
DependencyDescriptorisChanging in interface DependencyDescriptorpublic boolean isTransitive()
isTransitive in interface DependencyDescriptorpublic Namespace getNamespace()
getNamespace in interface DependencyDescriptorpublic java.lang.String getAttribute(java.lang.String attName)
ExtendableItemgetAttribute in interface ExtendableItemattName - the name of the attribute to getpublic java.util.Map 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 getExtraAttributes()
ExtendableItemgetExtraAttributes in interface ExtendableItemExtendableItem.getQualifiedExtraAttributes()public java.util.Map 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 DependencyDescriptor asSystem()
asSystem in interface DependencyDescriptorpublic ModuleRevisionId getSourceModule()
getSourceModule in interface InheritableItempublic DependencyDescriptor clone(ModuleRevisionId revision)
DependencyDescriptorclone in interface DependencyDescriptorrevision - the revision of the cloned dependency descriptor