org.apache.ivy.core.module.descriptor

Interface DependencyDescriptor

public interface DependencyDescriptor extends ExtendableItem

Describes a dependency from a depender to a dependee.

The main information this descriptor contains is the constraint on the dependency. There is actually two kind of dependency constraints: the default dependency constraint, which can be obtained with getDependencyRevisionId, and corresponds to the rev attribute in Ivy files. This is the constraint as it should be honored by Ivy in default resolve mode.

Then there is the dynamic constraint, which can either be the same as the default constraint, or the original dependency constraint when an Ivy file is delivered an published to a repository. This dynamic constraint is returned by getDynamicConstraintDependencyRevisionId, and corresponds to the revconstraint attribute in the Ivy file. In some resolve mode, this constraint can be used instead of the default dependency constraint when performing dependency resolution.

Method Summary
DependencyDescriptorasSystem()
booleancanExclude()
Returns true if this descriptor contains any exclusion rule
DependencyDescriptorclone(ModuleRevisionId revision)
Clones current dependency descriptor with another revision.
booleandoesExclude(String[] moduleConfigurations, ArtifactId artifactId)
Returns true if
DependencyArtifactDescriptor[]getAllDependencyArtifacts()
ExcludeRule[]getAllExcludeRules()
IncludeRule[]getAllIncludeRules()
DependencyArtifactDescriptor[]getDependencyArtifacts(String moduleConfigurations)
DependencyArtifactDescriptor[]getDependencyArtifacts(String[] moduleConfigurations)
String[]getDependencyConfigurations(String moduleConfiguration, String requestedConfiguration)
String[]getDependencyConfigurations(String moduleConfiguration)
String[]getDependencyConfigurations(String[] moduleConfigurations)
ModuleIdgetDependencyId()
ModuleRevisionIdgetDependencyRevisionId()
Returns the constraint on dependency this descriptor represents.
ModuleRevisionIdgetDynamicConstraintDependencyRevisionId()
Returns the dynamic constraint on dependency this descriptor represents.
ExcludeRule[]getExcludeRules(String moduleConfigurations)
ExcludeRule[]getExcludeRules(String[] moduleConfigurations)
IncludeRule[]getIncludeRules(String moduleConfigurations)
IncludeRule[]getIncludeRules(String[] moduleConfigurations)
String[]getModuleConfigurations()
NamespacegetNamespace()
ModuleRevisionIdgetParentRevisionId()
booleanisChanging()
Used 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.
booleanisTransitive()

Method Detail

asSystem

public DependencyDescriptor asSystem()

canExclude

public boolean canExclude()
Returns true if this descriptor contains any exclusion rule

Returns: true if this descriptor contains any exclusion rule

clone

public DependencyDescriptor clone(ModuleRevisionId revision)
Clones current dependency descriptor with another revision.

Parameters: revision the revision of the cloned dependency descriptor

Returns: the cloned dependency descriptor

Throws: IllegalArgumentException if the given ModuleRevisionId has not the same ModuleId as the ModuleRevisionId of this descriptor.

doesExclude

public boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId)
Returns true if

Parameters: moduleConfigurations artifactId

Returns:

getAllDependencyArtifacts

public DependencyArtifactDescriptor[] getAllDependencyArtifacts()

getAllExcludeRules

public ExcludeRule[] getAllExcludeRules()

getAllIncludeRules

public IncludeRule[] getAllIncludeRules()

getDependencyArtifacts

public DependencyArtifactDescriptor[] getDependencyArtifacts(String moduleConfigurations)

getDependencyArtifacts

public DependencyArtifactDescriptor[] getDependencyArtifacts(String[] moduleConfigurations)

getDependencyConfigurations

public String[] getDependencyConfigurations(String moduleConfiguration, String requestedConfiguration)

getDependencyConfigurations

public String[] getDependencyConfigurations(String moduleConfiguration)

getDependencyConfigurations

public String[] getDependencyConfigurations(String[] moduleConfigurations)

getDependencyId

public ModuleId getDependencyId()

getDependencyRevisionId

public ModuleRevisionId getDependencyRevisionId()
Returns the constraint on dependency this descriptor represents.

Returns: the constraint on dependency.

getDynamicConstraintDependencyRevisionId

public ModuleRevisionId getDynamicConstraintDependencyRevisionId()
Returns the dynamic constraint on dependency this descriptor represents.

Returns: the dynamic constraint on dependency, or exact constraint if no dynamic constraint is specified.

getExcludeRules

public ExcludeRule[] getExcludeRules(String moduleConfigurations)

getExcludeRules

public ExcludeRule[] getExcludeRules(String[] moduleConfigurations)

getIncludeRules

public IncludeRule[] getIncludeRules(String moduleConfigurations)

getIncludeRules

public IncludeRule[] getIncludeRules(String[] moduleConfigurations)

getModuleConfigurations

public String[] getModuleConfigurations()

getNamespace

public Namespace getNamespace()

getParentRevisionId

public ModuleRevisionId getParentRevisionId()

isChanging

public boolean isChanging()
Used 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.

Returns: true if this dependency is a changing one

isForce

public boolean isForce()
Used 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.

Returns: true if this dependency should be used, false if conflicts manager can do its work.

isTransitive

public boolean isTransitive()