org.apache.maven.plugins.release.versions
public class DefaultVersionInfo extends Object implements VersionInfo, Cloneable
The supported version scheme has the following parts.
component-digits-annotation-annotationRevision-buildSpecifier
Example:
my-component-1.0.1-alpha-2-SNAPSHOT
Implementation details:
The separators "_" and "-" between components are also optional (though they are usually reccommended).
Example:
log4j-1.2.9-beta-9-SNAPSHOT == log4j1.2.9beta9SNAPSHOT == log4j_1.2.9_beta_9_SNAPSHOT
All numbers in the "digits" part of the version are considered Integers. Therefore 1.01.01 is the same as 1.1.1 Leading zeros are ignored when performing comparisons.
| Field Summary | |
|---|---|
| protected String | annotation |
| protected List | annotationOrder |
| protected String | annotationRevision |
| protected String | annotationRevSeparator |
| protected String | annotationSeparator |
| protected String | buildSeparator |
| protected String | buildSpecifier |
| protected String | component |
| protected List | digits |
| protected String | digitSeparator |
| protected static Pattern | DIGIT_SEPARATOR_PATTERN |
| protected static String | DIGIT_SEPARATOR_STRING |
| protected String | strVersion |
| static String | SNAPSHOT_IDENTIFIER |
| protected static Pattern | STANDARD_PATTERN |
| Constructor Summary | |
|---|---|
| DefaultVersionInfo(String version) Constructs this object and parses the supplied version string.
| |
| Method Summary | |
|---|---|
| int | compareTo(Object obj) Compares this DefaultVersionInfo to the supplied DefaultVersionInfo
to determine which version is greater.
|
| String | getAnnotation() |
| List | getAnnotationOrder() |
| String | getAnnotationRevision() |
| String | getBuildSpecifier() |
| String | getComponent() |
| List | getDigits() |
| VersionInfo | getNextVersion() |
| String | getReleaseVersionString() |
| String | getSnapshotVersionString() |
| String | getVersionString() |
| protected static String | getVersionString(DefaultVersionInfo info, String buildSpecifier, String buildSeparator) |
| protected String | incrementVersionString(String s) Takes a string and increments it as an integer.
|
| boolean | isSnapshot() |
| protected static String | joinDigitString(List digits) Simply joins the items in the list with "." period
|
| protected List | parseDigits(String strDigits) Splits the string on "." and returns a list
containing each digit.
|
| protected void | parseVersion(String version) Internal routine for parsing the supplied version string into its parts.
|
| protected void | setAnnotation(String annotation) |
| protected void | setAnnotationOrder(List annotationOrder) |
| protected void | setAnnotationRevision(String annotationRevision) |
| protected void | setBuildSpecifier(String buildSpecifier) |
| protected void | setComponent(String component) |
| protected void | setDigits(List digits) |
Parameters: version
Decision order is: digits, annotation, annotationRev, buildSpecifier.
Presence of an annotation is considered to be less than an equivalent version without an annotation.
Example: 1.0 is greater than 1.0-alpha.
The getAnnotationOrder is used in determining the rank order of annotations.
For example: alpha < beta < RC < release
Parameters: that
Returns:
Throws: IllegalArgumentException if the components differ between the objects or if either of the annotations can not be determined.
Parameters: s
Returns:
Parameters: digits
Returns:
Parameters: strDigits
Returns:
Parameters: version