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
|
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 DependencyDescriptor
public ModuleRevisionId getDependencyRevisionId()
DependencyDescriptor
getDependencyRevisionId
in interface DependencyDescriptor
public ModuleRevisionId getDynamicConstraintDependencyRevisionId()
DependencyDescriptor
getDynamicConstraintDependencyRevisionId
in interface DependencyDescriptor
public java.lang.String[] getModuleConfigurations()
getModuleConfigurations
in interface DependencyDescriptor
public java.lang.String[] getDependencyConfigurations(java.lang.String moduleConfiguration)
getDependencyConfigurations
in interface DependencyDescriptor
public 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 DependencyDescriptor
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)
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 DependencyDescriptor
public DependencyArtifactDescriptor[] getDependencyArtifacts(java.lang.String moduleConfiguration)
getDependencyArtifacts
in interface DependencyDescriptor
public IncludeRule[] getIncludeRules(java.lang.String moduleConfiguration)
getIncludeRules
in interface DependencyDescriptor
public ExcludeRule[] getExcludeRules(java.lang.String moduleConfiguration)
getExcludeRules
in interface DependencyDescriptor
public DependencyArtifactDescriptor[] getDependencyArtifacts(java.lang.String[] moduleConfigurations)
getDependencyArtifacts
in interface DependencyDescriptor
public IncludeRule[] getIncludeRules(java.lang.String[] moduleConfigurations)
getIncludeRules
in interface DependencyDescriptor
public ExcludeRule[] getExcludeRules(java.lang.String[] moduleConfigurations)
getExcludeRules
in interface DependencyDescriptor
public DependencyArtifactDescriptor[] getAllDependencyArtifacts()
getAllDependencyArtifacts
in interface DependencyDescriptor
public IncludeRule[] getAllIncludeRules()
getAllIncludeRules
in interface DependencyDescriptor
public ExcludeRule[] getAllExcludeRules()
getAllExcludeRules
in interface DependencyDescriptor
public 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 DependencyDescriptor
public boolean canExclude()
canExclude
in interface DependencyDescriptor
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isForce()
DependencyDescriptor
isForce
in interface DependencyDescriptor
public ModuleRevisionId getParentRevisionId()
getParentRevisionId
in interface DependencyDescriptor
public boolean isChanging()
DependencyDescriptor
isChanging
in interface DependencyDescriptor
public boolean isTransitive()
isTransitive
in interface DependencyDescriptor
public Namespace getNamespace()
getNamespace
in interface DependencyDescriptor
public java.lang.String getAttribute(java.lang.String attName)
ExtendableItem
getAttribute
in interface ExtendableItem
attName
- the name of the attribute to getpublic java.util.Map getAttributes()
ExtendableItem
getAttributes
in interface ExtendableItem
public java.lang.String getExtraAttribute(java.lang.String attName)
ExtendableItem
getExtraAttribute
in interface ExtendableItem
attName
- the name of the extra attribute to get. This name can be either qualified or
unqualified.public java.util.Map getExtraAttributes()
ExtendableItem
getExtraAttributes
in interface ExtendableItem
ExtendableItem.getQualifiedExtraAttributes()
public java.util.Map getQualifiedExtraAttributes()
ExtendableItem
The 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 ExtendableItem
ExtendableItem.getExtraAttributes()
public DependencyDescriptor asSystem()
asSystem
in interface DependencyDescriptor
public ModuleRevisionId getSourceModule()
getSourceModule
in interface InheritableItem
public DependencyDescriptor clone(ModuleRevisionId revision)
DependencyDescriptor
clone
in interface DependencyDescriptor
revision
- the revision of the cloned dependency descriptor