public final class JkScopedDependency
extends java.lang.Object
implements java.io.Serializable
JkScope
s nor JkScopeMapping
.
Jerkar uses Ivy under the hood for dependency resolution. Internally JkScope
are turned to Ivy 'configuration'
and JkScopeMapping
are turned to Ivy 'configurationMapping'.
To understand how scope and mapping scope influence resolution, you can visit this page.Modifier and Type | Class and Description |
---|---|
static class |
JkScopedDependency.ScopeType
Type for the scope.
SIMPLE means that the the .
MAPPED means that the scoped dependency is declared with a
JkScopeMapping .
UNSET means that the scoped dependency has been declared with no scope and no scope mapping.
|
Modifier and Type | Method and Description |
---|---|
JkDependency |
getDependency()
Returns the dependency object of this scoped dependency.
|
JkScopeMapping |
getScopeMapping()
Returns the scope mapping this scoped dependency is declared with.
|
java.util.Set<JkScope> |
getScopes()
Returns a the scopes this scoped dependency.
|
JkScopedDependency.ScopeType |
getScopeType()
Return wether this scoped dependency is declared with either scope nor scope mapping.
|
boolean |
isInvolvedIn(JkScope scope)
Returns
true if this scoped dependency should be taken in account when one grabs the dependencies for
the specified scope. |
boolean |
isInvolvedInAnyOf(java.lang.Iterable<JkScope> scopes)
Returns
true if this scoped dependency should be taken in account when one grabs the dependencies for
any of the specified scopes. |
boolean |
isInvolvedInAnyOf(JkScope... scopes)
Returns
true if this scoped dependency should be taken in account when one grabs the dependencies for
any of the specified scopes. |
static JkScopedDependency |
of(JkDependency dependency,
JkScope... scopes)
Creates a
JkScopedDependency to the specified dependency and scopes. |
static JkScopedDependency |
of(JkDependency dependency,
java.util.Set<JkScope> scopes)
Creates a
JkScopedDependency to the specified dependency and scopes. |
static JkScopedDependency |
of(JkModuleDependency dependency,
JkScopeMapping scopeMapping)
Creates a
JkScopedDependency to the specified dependency and scope mapping. |
java.lang.String |
toString() |
JkScopedDependency |
withDependency(JkDependency dependency)
Returns a scoped dependency formed of the scope/scopeMapping of this scoped dependency
and the specified dependency.
|
JkScopedDependency |
withScopeMapping(JkScopeMapping scopeMapping)
Returns a scoped dependency identical to this one but with the specified scope mapping and no scopes.
|
JkScopedDependency |
withScopes(JkScope... scopes)
Returns a scoped dependency identical to this one but with the specified scopes.
|
JkScopedDependency |
withScopes(java.util.Set<JkScope> scopes)
Returns a scoped dependency identical to this one but with the specified scopes.
|
public static JkScopedDependency of(JkModuleDependency dependency, JkScopeMapping scopeMapping)
JkScopedDependency
to the specified dependency and scope mapping.public static JkScopedDependency of(JkDependency dependency, JkScope... scopes)
JkScopedDependency
to the specified dependency and scopes.public static JkScopedDependency of(JkDependency dependency, java.util.Set<JkScope> scopes)
JkScopedDependency
to the specified dependency and scopes.public JkDependency getDependency()
public boolean isInvolvedIn(JkScope scope)
true
if this scoped dependency should be taken in account when one grabs the dependencies for
the specified scope.public boolean isInvolvedInAnyOf(java.lang.Iterable<JkScope> scopes)
true
if this scoped dependency should be taken in account when one grabs the dependencies for
any of the specified scopes.public boolean isInvolvedInAnyOf(JkScope... scopes)
true
if this scoped dependency should be taken in account when one grabs the dependencies for
any of the specified scopes.public JkScopedDependency.ScopeType getScopeType()
JkScopedDependency.ScopeType.UNSET
.public java.util.Set<JkScope> getScopes()
public JkScopedDependency withScopes(java.util.Set<JkScope> scopes)
public JkScopedDependency withScopeMapping(JkScopeMapping scopeMapping)
JkModuleDependency
.
If it is not the case, an IllegalStateException
is thrown.public JkScopedDependency withScopes(JkScope... scopes)
public JkScopeMapping getScopeMapping()
public JkScopedDependency withDependency(JkDependency dependency)
public java.lang.String toString()
toString
in class java.lang.Object