org.codehaus.mojo.pomtools.wrapper.custom
Class ModelVersionRange
java.lang.Object
org.codehaus.mojo.pomtools.wrapper.custom.ModelVersionRange
public final class ModelVersionRange
- extends java.lang.Object
- Version:
- $Id: ModelVersionRange.java 2166 2006-07-18 21:32:16Z carlos $
- Author:
- David Hawkins
Constructor Summary |
ModelVersionRange(org.apache.maven.artifact.versioning.VersionRange range)
|
Method Summary |
boolean |
containsVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
VersionRange.hasRestrictions() doesn't verify that it has restrictions when
it checks containsVersion and throws an NPE if the range was created on a single version. |
boolean |
containsVersion(java.lang.String version)
|
static ModelVersionRange |
createFromVersionSpec(java.lang.String spec)
|
java.util.List |
getRestrictions()
|
boolean |
hasRestrictions()
VersionRange.hasRestrictions() returns false if it has a recommendedVersion regarless
of whether it has restrictions or not. |
static boolean |
hasRestrictions(org.apache.maven.artifact.versioning.VersionRange range)
VersionRange.hasRestrictions() returns false if it has a recommendedVersion regarless
of whether it has restrictions or not. |
java.lang.String |
toString()
VersionRange.toString() simply returns the recommended version if it has
a recommended version; otherwise it builds a proper string based on the restrictions. |
static java.lang.String |
toString(org.apache.maven.artifact.versioning.VersionRange range)
VersionRange.toString() simply returns the recommended version if it has
a recommended version; otherwise it builds a proper string based on the restrictions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ModelVersionRange
public ModelVersionRange(org.apache.maven.artifact.versioning.VersionRange range)
createFromVersionSpec
public static ModelVersionRange createFromVersionSpec(java.lang.String spec)
throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
- Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
containsVersion
public boolean containsVersion(java.lang.String version)
containsVersion
public boolean containsVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
VersionRange.hasRestrictions()
doesn't verify that it has restrictions when
it checks containsVersion and throws an NPE if the range was created on a single version.
- Parameters:
version
-
- Returns:
hasRestrictions
public boolean hasRestrictions()
VersionRange.hasRestrictions()
returns false if it has a recommendedVersion regarless
of whether it has restrictions or not. We actually need to know if it has restrictions,
so this function re-implements the hasRestrictions to actually determine if the range has
restrictions.
hasRestrictions
public static boolean hasRestrictions(org.apache.maven.artifact.versioning.VersionRange range)
VersionRange.hasRestrictions()
returns false if it has a recommendedVersion regarless
of whether it has restrictions or not. We actually need to know if it has restrictions,
so this function re-implements the hasRestrictions to actually determine if the range has
restrictions.
toString
public java.lang.String toString()
VersionRange.toString()
simply returns the recommended version if it has
a recommended version; otherwise it builds a proper string based on the restrictions.
We need the string build with restrictions if there are any; so this is a copy of the guts
of VersionRange.toString()
except we build the string with restrictions regardless
of having a recommendedVersion.
- Overrides:
toString
in class java.lang.Object
toString
public static java.lang.String toString(org.apache.maven.artifact.versioning.VersionRange range)
VersionRange.toString()
simply returns the recommended version if it has
a recommended version; otherwise it builds a proper string based on the restrictions.
We need the string build with restrictions if there are any; so this is a copy of the guts
of VersionRange.toString()
except we build the string with restrictions regardless
of having a recommendedVersion.
getRestrictions
public java.util.List getRestrictions()
Copyright © 2009 The Codehaus. All Rights Reserved.