|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.matthias_burbach.deputy.core.rule.RuleSet
Holds all the rules to be used in the dependency recursion of a project.
Field Summary | |
static java.lang.String |
DEFAULT_RULE_LATEST_RELEASE
The default rule 'LATEST RELEASE'. |
static java.lang.String |
DEFAULT_RULE_LATEST_RELEASE_NO_SCAN
The default rule 'LATEST RELEASE (no scan)'. |
static java.lang.String |
DEFAULT_RULE_PRESENT_RELEASE
The default rule 'PRESENT RELEASE'. |
static java.lang.String |
DEFAULT_RULE_SNAPSHOT
The default rule 'SNAPSHOT'. |
Constructor Summary | |
RuleSet()
|
Method Summary | |
void |
add(Rule rule)
Adds a rule to this rule set. |
void |
add(RuleSet ruleSet)
Adds all rules of the rule set to this rule set. |
void |
addChangeListener(RuleSetChangeListener listener)
|
java.util.List |
getAllRules()
|
java.lang.String |
getDefaultRule()
|
DeprecationRule |
getDeprecationRule(java.lang.String artifactId,
java.lang.String version)
|
java.util.List |
getDeprecationRules()
|
java.lang.String |
getEnforcedVersion(java.lang.String artifactId)
|
EnforcementRule |
getEnforcementRule(java.lang.String artifactId)
|
java.util.List |
getEnforcementRules()
|
int |
getNumberOfDerivedRules()
|
int |
getNumberOfSnapshotEnforcements()
|
java.util.List |
getRemovalRules()
|
ReplacementRule |
getReplacementRule(java.lang.String artifactId,
java.lang.String version)
|
java.util.List |
getReplacementRules()
|
RetentionRule |
getRetentionRule(java.lang.String artifactId,
java.lang.String version)
|
java.util.List |
getRetentionRules()
|
Rule |
getRuleForKey(Rule rule)
|
boolean |
hasRuleForKey(Rule rule)
|
boolean |
hasSameRule(Rule rule)
|
boolean |
isDeprecated(java.lang.String artifactId,
java.lang.String version)
|
boolean |
isRemoved(java.lang.String artifactId,
java.lang.String version)
|
boolean |
isRetained(java.lang.String artifactId,
java.lang.String version)
Checks whether there is a retention rule that governs to retain the version of the artifact when encountered during the process of applying the rules. |
void |
remove(Rule rule)
Removes a rule from this rule set. |
void |
removeAllDerivedEnforcementRules()
Removes all rules of type EnforcementRule if their property 'derived' is true. |
void |
removeAllDerivedRules()
Removes all rules of type Rule if their property 'derived' is true. |
void |
removeAllSnapshotEnforcements()
Removes all SNAPSHOT enforcement rules at once. |
void |
removeChangeListener(RuleSetChangeListener listener)
|
void |
setDefaultRule(java.lang.String defaultRule)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_RULE_LATEST_RELEASE
public static final java.lang.String DEFAULT_RULE_SNAPSHOT
public static final java.lang.String DEFAULT_RULE_LATEST_RELEASE_NO_SCAN
public static final java.lang.String DEFAULT_RULE_PRESENT_RELEASE
Constructor Detail |
public RuleSet()
Method Detail |
public void add(Rule rule)
rule
- The rule to add.public void remove(Rule rule)
rule
- The rule to remove.public int getNumberOfSnapshotEnforcements()
public int getNumberOfDerivedRules()
public void removeAllSnapshotEnforcements()
public void add(RuleSet ruleSet)
ruleSet
- The rule set whose rules to add.public java.util.List getEnforcementRules()
EnforcementRule
.public java.util.List getDeprecationRules()
DeprecationRule
.public java.util.List getReplacementRules()
ReplacementRule
.public java.util.List getRemovalRules()
RemovalRule
.public java.util.List getRetentionRules()
RetentionRule
.public java.util.List getAllRules()
Rule
.public java.lang.String getEnforcedVersion(java.lang.String artifactId)
artifactId
- The id of the artifact to get the version to enforce
for
public EnforcementRule getEnforcementRule(java.lang.String artifactId)
artifactId
- The id of the artifact to get an enforcement rule for.
null
.public DeprecationRule getDeprecationRule(java.lang.String artifactId, java.lang.String version)
artifactId
- The id of the artifact to get a deprecation rule for.version
- The version of the artifact to get a deprecation rule for.
null
.public boolean isDeprecated(java.lang.String artifactId, java.lang.String version)
artifactId
- The id of the artifact to check for.version
- The version of the artifact to check for.
true
if the version of this artifact is deprecatedpublic ReplacementRule getReplacementRule(java.lang.String artifactId, java.lang.String version)
artifactId
- The id of the artifact to get a replacement rule for.version
- The version of the artifact to get a replacement rule for.
Can be null
.
null
.public RetentionRule getRetentionRule(java.lang.String artifactId, java.lang.String version)
artifactId
- The id of the artifact to get a retention rule for.version
- The version of the artifact to get a retention rule for.
Can be null
.
null
.public boolean isRemoved(java.lang.String artifactId, java.lang.String version)
artifactId
- The id of the artifact to check for.version
- The version of the artifact to check for.
true
if the version of this artifact is removedpublic java.lang.String getDefaultRule()
public void setDefaultRule(java.lang.String defaultRule)
defaultRule
- The default rule to set. See DEFAULT_RULE_* constants.public void addChangeListener(RuleSetChangeListener listener)
listener
- The change listener to add.public void removeChangeListener(RuleSetChangeListener listener)
listener
- The change listener to remove.public boolean hasRuleForKey(Rule rule)
rule
- The rule to check for.
true
if this rule set has a rule under the same key.public boolean hasSameRule(Rule rule)
rule
- The rule to check for.
true
if this rule set has exactly this object
instance of the rule passed in.public Rule getRuleForKey(Rule rule)
rule
- The rule instance to find under the same key.
null
.public void removeAllDerivedRules()
public void removeAllDerivedEnforcementRules()
public boolean isRetained(java.lang.String artifactId, java.lang.String version)
artifactId
- The artifact id of the project to check.version
- The version of the project to check.
true
if and only if there is a retention rule in
this rule set that matches the artifact id (and the version).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |