public abstract class AbstractVersionEnforcer extends AbstractStandardEnforcerRule
Constructor and Description |
---|
AbstractVersionEnforcer() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsVersion(VersionRange allowedRange,
ArtifactVersion theVersion)
Copied from Artifact.VersionRange.
|
void |
enforceVersion(Log log,
String variableName,
String requiredVersionRange,
ArtifactVersion actualVersion)
Compares the specified version to see if it is allowed by the defined version range.
|
String |
getCacheId() |
String |
getVersion()
Gets the required version.
|
boolean |
isCacheable() |
boolean |
isResultValid(EnforcerRule theCachedRule) |
void |
setVersion(String theVersion)
Specify the required version.
|
getLevel, getMessage, setLevel, setMessage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
public AbstractVersionEnforcer()
public void enforceVersion(Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion) throws EnforcerRuleException
log
- the logvariableName
- name of variable to use in messages (Example: "Maven" or "Java" etc).requiredVersionRange
- range of allowed versions.actualVersion
- the version to be checked.EnforcerRuleException
- the enforcer rule exceptionpublic static boolean containsVersion(VersionRange allowedRange, ArtifactVersion theVersion)
allowedRange
- range of allowed versions.theVersion
- the version to be checked.public String getCacheId()
public boolean isCacheable()
public boolean isResultValid(EnforcerRule theCachedRule)
public final String getVersion()
public final void setVersion(String theVersion)
2.0.4
Version 2.0.4 and higher (different from Maven meaning)[2.0,2.1)
Versions 2.0 (included) to 2.1 (not included)[2.0,2.1]
Versions 2.0 to 2.1 (both included)[2.0.5,)
Versions 2.0.5 and higher(,2.0.5],[2.1.1,)
Versions up to 2.0.5 (included) and 2.1.1 or highertheVersion
- the required version to setCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.