|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule org.apache.maven.plugins.enforcer.AbstractVersionEnforcer
public abstract class AbstractVersionEnforcer
Contains the common code to compare a version against a version range.
Field Summary | |
---|---|
String |
version
Specify the required version. |
Fields inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule |
---|
message |
Constructor Summary | |
---|---|
AbstractVersionEnforcer()
|
Method Summary | |
---|---|
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)
Sets the required version. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public String version
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 higher
Constructor Detail |
---|
public AbstractVersionEnforcer()
Method Detail |
---|
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.
MojoExecutionException
- if the version is not allowed.
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 String getVersion()
public void setVersion(String theVersion)
theVersion
- the required version to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |