org.codehaus.mojo.pomtools.wrapper.custom
Class ModelVersionRange
java.lang.Object
org.codehaus.mojo.pomtools.wrapper.custom.ModelVersionRange
public final class ModelVersionRange
- extends 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(String version)
|
static ModelVersionRange |
createFromVersionSpec(String spec)
|
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. |
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 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. |
ModelVersionRange
public ModelVersionRange(org.apache.maven.artifact.versioning.VersionRange range)
createFromVersionSpec
public static ModelVersionRange createFromVersionSpec(String spec)
throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
- Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
containsVersion
public boolean containsVersion(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 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 Object
toString
public static 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 List getRestrictions()
Copyright © 2011 The Codehaus. All Rights Reserved.