Class DefaultDependencyDescriptor
- All Implemented Interfaces:
DependencyDescriptor, InheritableItem, ExtendableItem
- Direct Known Subclasses:
PomModuleDescriptorBuilder.PomDependencyDescriptor
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDependencyDescriptor(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) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependencyArtifact(String masterConf, DependencyArtifactDescriptor dad) voidaddDependencyConfiguration(String masterConf, String depConf) voidaddExcludeRule(String masterConf, ExcludeRule rule) voidaddIncludeRule(String masterConf, IncludeRule rule) asSystem()booleanclone(ModuleRevisionId revision) Clones current dependency descriptor with another revision.booleandoesExclude(String[] moduleConfigurations, ArtifactId artifactId) only works when namespace is properly set.getAttribute(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.Returns a Map of all attributes of this extendable item, including standard and extra ones.getDependencyArtifacts(String moduleConfiguration) getDependencyArtifacts(String[] moduleConfigurations) String[]getDependencyConfigurations(String moduleConfiguration) String[]getDependencyConfigurations(String[] moduleConfigurations) String[]getDependencyConfigurations(String moduleConfiguration, String requestedConfiguration) Return the dependency configurations mapped to the given moduleConfiguration, actually resolved because of the given requestedConfigurationReturns the constraint on dependency this descriptor represents.Returns the dynamic constraint on dependency this descriptor represents.getExcludeRules(String moduleConfiguration) getExcludeRules(String[] moduleConfigurations) getExtraAttribute(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)Returns a Map of all extra attributes of this extendable item.getIncludeRules(String moduleConfiguration) getIncludeRules(String[] moduleConfigurations) String[]Returns theModuleDescriptordeclaring this dependency descriptor.Returns a Map of all extra attributes of this extendable item.booleanUsed to indicate that this dependency is a changing one.booleanisForce()Used to indicate that this revision must be used in case of conflicts, independently of conflicts manager.booleanprotected static StringreplaceFallbackConfigurationPattern(Pattern pattern, String conf, String moduleConfiguration) Replaces fallback patterns with correct values if fallback pattern exists.protected static StringreplaceSelfFallbackPattern(String conf, String moduleConfiguration) protected static StringreplaceThisFallbackPattern(String conf, String requestedConfiguration) toString()static DependencyDescriptorTransforms the given dependency descriptor of the given namespace and return a new dependency descriptor in the system namespace.static DefaultDependencyDescriptortransformInstance(DependencyDescriptor dd, NamespaceTransformer t, boolean fromSystem) Transforms a dependency descriptor using the given transformer.
-
Constructor Details
-
DefaultDependencyDescriptor
public DefaultDependencyDescriptor(ModuleDescriptor md, ModuleRevisionId mrid, boolean force, boolean changing, boolean transitive) -
DefaultDependencyDescriptor
-
DefaultDependencyDescriptor
-
DefaultDependencyDescriptor
public DefaultDependencyDescriptor(ModuleDescriptor md, ModuleRevisionId mrid, ModuleRevisionId dynamicConstraint, boolean force, boolean changing, boolean transitive)
-
-
Method Details
-
transformInstance
Transforms the given dependency descriptor of the given namespace and return a new dependency descriptor in the system namespace. Note that exclude rules are not converted in system namespace, because they aren't transformable (the name space hasn't the ability to convert regular expressions). However, method doesExclude will work with system artifacts.- Parameters:
dd- DependencyDescriptorns- Namespace- Returns:
- DependencyDescriptor
-
transformInstance
public static DefaultDependencyDescriptor transformInstance(DependencyDescriptor dd, NamespaceTransformer t, boolean fromSystem) Transforms a dependency descriptor using the given transformer. Note that no namespace info will be attached to the transformed dependency descriptor, so calling doesExclude is not recommended (doesExclude only works when namespace is properly set)- Parameters:
dd- DependencyDescriptort- NamespaceTransformerfromSystem- boolean- Returns:
- DefaultDependencyDescriptor
-
getDependencyId
- Specified by:
getDependencyIdin interfaceDependencyDescriptor
-
getModuleDescriptor
Description copied from interface:DependencyDescriptorReturns theModuleDescriptordeclaring this dependency descriptor. Returns null if this dependency descriptor is not declared in aModuleDescriptor.- Specified by:
getModuleDescriptorin interfaceDependencyDescriptor- Returns:
- the
ModuleDescriptorof this dependency descriptor
-
getDependencyRevisionId
Description copied from interface:DependencyDescriptorReturns the constraint on dependency this descriptor represents.- Specified by:
getDependencyRevisionIdin interfaceDependencyDescriptor- Returns:
- the constraint on dependency.
-
getDynamicConstraintDependencyRevisionId
Description copied from interface:DependencyDescriptorReturns the dynamic constraint on dependency this descriptor represents.- Specified by:
getDynamicConstraintDependencyRevisionIdin interfaceDependencyDescriptor- Returns:
- the dynamic constraint on dependency, or exact constraint if no dynamic constraint is specified.
-
getModuleConfigurations
- Specified by:
getModuleConfigurationsin interfaceDependencyDescriptor
-
getDependencyConfigurations
- Specified by:
getDependencyConfigurationsin interfaceDependencyDescriptor
-
getDependencyConfigurations
public String[] getDependencyConfigurations(String moduleConfiguration, String requestedConfiguration) Return the dependency configurations mapped to the given moduleConfiguration, actually resolved because of the given requestedConfigurationUsually 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.
- Specified by:
getDependencyConfigurationsin interfaceDependencyDescriptor- Parameters:
moduleConfiguration- StringrequestedConfiguration- String- Returns:
- String[]
-
replaceSelfFallbackPattern
-
replaceThisFallbackPattern
-
replaceFallbackConfigurationPattern
protected static String replaceFallbackConfigurationPattern(Pattern pattern, String conf, String moduleConfiguration) Replaces fallback patterns with correct values if fallback pattern exists.- Parameters:
pattern- pattern to look forconf- configuration mapping from dependency elementmoduleConfiguration- module's configuration to use for replacement- Returns:
- Replaced string if pattern matched. Otherwise null.
-
getDependencyConfigurations
- Specified by:
getDependencyConfigurationsin interfaceDependencyDescriptor
-
getDependencyArtifacts
- Specified by:
getDependencyArtifactsin interfaceDependencyDescriptor
-
getIncludeRules
- Specified by:
getIncludeRulesin interfaceDependencyDescriptor
-
getExcludeRules
- Specified by:
getExcludeRulesin interfaceDependencyDescriptor
-
getDependencyArtifacts
- Specified by:
getDependencyArtifactsin interfaceDependencyDescriptor
-
getIncludeRules
- Specified by:
getIncludeRulesin interfaceDependencyDescriptor
-
getExcludeRules
- Specified by:
getExcludeRulesin interfaceDependencyDescriptor
-
getAllDependencyArtifacts
- Specified by:
getAllDependencyArtifactsin interfaceDependencyDescriptor
-
getAllIncludeRules
- Specified by:
getAllIncludeRulesin interfaceDependencyDescriptor
-
getAllExcludeRules
- Specified by:
getAllExcludeRulesin interfaceDependencyDescriptor
-
addDependencyConfiguration
-
addDependencyArtifact
-
addIncludeRule
-
addExcludeRule
-
doesExclude
only works when namespace is properly set. The behaviour is not specified if namespace is not set.- Specified by:
doesExcludein interfaceDependencyDescriptor- Parameters:
moduleConfigurations- String[]artifactId- ditto- Returns:
- boolean
-
canExclude
public boolean canExclude()- Specified by:
canExcludein interfaceDependencyDescriptor- Returns:
- true if this descriptor contains any exclusion rule
-
toString
-
isForce
public boolean isForce()Description copied from interface:DependencyDescriptorUsed to indicate that this revision must be used in case of conflicts, independently of conflicts manager. This only works for direct dependencies, and not transitive ones.- Specified by:
isForcein interfaceDependencyDescriptor- Returns:
- true if this dependency should be used, false if conflicts manager can do its work.
-
getParentRevisionId
- Specified by:
getParentRevisionIdin interfaceDependencyDescriptor
-
isChanging
public boolean isChanging()Description copied from interface:DependencyDescriptorUsed to indicate that this dependency is a changing one. A changing dependency in ivy means that the revision may have its artifacts modified without revision change. When new artifacts are published a new ivy file should also be published with a new publication date to indicate to ivy that artifacts have changed and that they should be downloaded again.- Specified by:
isChangingin interfaceDependencyDescriptor- Returns:
- true if this dependency is a changing one
-
isTransitive
public boolean isTransitive()- Specified by:
isTransitivein interfaceDependencyDescriptor
-
getNamespace
- Specified by:
getNamespacein interfaceDependencyDescriptor
-
getAttribute
Description copied from interface:ExtendableItemGets the value of an attribute Can be used to access the value of a standard attribute (like organisation, revision) or of an extra attribute.- Specified by:
getAttributein interfaceExtendableItem- Parameters:
attName- the name of the attribute to get- Returns:
- the value of the attribute, null if the attribute doesn't exist
-
getAttributes
Description copied from interface:ExtendableItemReturns a Map of all attributes of this extendable item, including standard and extra ones. The Map keys are attribute names as Strings, and values are corresponding attribute values (as String too). Extra attributes are included in unqualified form only.- Specified by:
getAttributesin interfaceExtendableItem- Returns:
- A Map instance containing all the attributes and their values.
-
getExtraAttribute
Description copied from interface:ExtendableItemGets 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)- Specified by:
getExtraAttributein interfaceExtendableItem- Parameters:
attName- the name of the extra attribute to get. This name can be either qualified or unqualified.- Returns:
- the value of the attribute, null if the attribute doesn't exist
-
getExtraAttributes
Description copied from interface:ExtendableItemReturns a Map of all extra attributes of this extendable item. The Map keys are unqualified attribute names as Strings, and values are corresponding attribute values (as String too)- Specified by:
getExtraAttributesin interfaceExtendableItem- Returns:
- A Map instance containing all the extra attributes and their values.
- See Also:
-
getQualifiedExtraAttributes
Description copied from interface:ExtendableItemReturns a Map of all extra attributes of this extendable item.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- Specified by:
getQualifiedExtraAttributesin interfaceExtendableItem- Returns:
- A Map instance containing all the extra attributes and their values.
- See Also:
-
asSystem
- Specified by:
asSystemin interfaceDependencyDescriptor
-
getSourceModule
- Specified by:
getSourceModulein interfaceInheritableItem- Returns:
- the module in which this item was actually defined, if different from the module in which the item appears. May be null.
-
clone
Description copied from interface:DependencyDescriptorClones current dependency descriptor with another revision.- Specified by:
clonein interfaceDependencyDescriptor- Parameters:
revision- the revision of the cloned dependency descriptor- Returns:
- the cloned dependency descriptor
-