Top Fields Constructors Methods
io.smallrye.common.version

pack-priv final Class MavenVersionIterator

extends AbstractVersionIterator
Class Inheritance
Imports
java.util.NoSuchElementException

Field Summary

Modifier and TypeField and Description
private static final String[]
Inherited from io.smallrye.common.version.AbstractVersionIterator:
cookiestring

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public StringBuilder
appendAlphaPartTo(final StringBuilder
the StringBuilder to append
b
)

Overrides io.smallrye.common.version.AbstractVersionIterator.appendAlphaPartTo.

Implements io.smallrye.common.version.VersionIterator.appendAlphaPartTo.

Append the current alphabetical part to the given string builder.

public StringBuilder
appendNumberPartTo(final StringBuilder
the StringBuilder to append
target
)

Overrides io.smallrye.common.version.AbstractVersionIterator.appendNumberPartTo.

Implements io.smallrye.common.version.VersionIterator.appendNumberPartTo.

Get the current numeric part, appending it to the given builder.

public StringBuilder
appendPartTo(final StringBuilder
the string builder (must not be null)
target
)

Overrides io.smallrye.common.version.AbstractVersionIterator.appendPartTo.

Implements io.smallrye.common.version.VersionIterator.appendPartTo.

Append this version part to the given string builder.

pack-priv int
public int
public boolean
hasNext()

Overrides io.smallrye.common.version.AbstractVersionIterator.hasNext.

Implements io.smallrye.common.version.VersionIterator.hasNext.

A basic implementation of VersionIterator#hasNext() which returns true if there are more characters after the current token.

protected boolean
isAlphaCodePoint(final int
the code point to test
cp
)

Overrides io.smallrye.common.version.AbstractVersionIterator.isAlphaCodePoint.

Determine whether the given code point is a valid alpha code point according to the current scheme.

public boolean
public boolean
isEmptySeparator()

Overrides io.smallrye.common.version.AbstractVersionIterator.isEmptySeparator.

Implements io.smallrye.common.version.VersionIterator.isEmptySeparator.

Determine if the current token is an empty (or zero-length alphabetical-to-numeric or numeric-to-alphabetical) separator.

public boolean
public boolean
pack-priv boolean
protected boolean
isSeparatorCodePoint(final int
the code point to test
cp
)

Overrides io.smallrye.common.version.AbstractVersionIterator.isSeparatorCodePoint.

Determine whether the given code point is a valid separator according to the current scheme.

pack-priv boolean
public void
next()

Overrides io.smallrye.common.version.AbstractVersionIterator.next.

Implements io.smallrye.common.version.VersionIterator.next.

A basic implementation of VersionIterator#next() which uses the methods on this class to establish the next iteration token.

pack-priv boolean
pack-priv void
skipTrailer(long mark)

Inherited from io.smallrye.common.version.AbstractVersionIterator:
changeTypecompareAlphaPartcompareAlphaPartcompareNumberPartcompareNumberPartcompareNumberPartcompareNumberPartcookieToEndIndexcookieToExtraBitscookieToStartIndexcookieTypecurrentTypegetAlphaPartgetEndIndexgetExtraBitsgetNumberPartAsIntgetNumberPartAsLonggetNumberPartAsStringgetStartIndexinsertEmptyAlphainsertEmptyNumberinsertEmptySeparatorisPartisSeparatorlengthmakeCookiemarknumericCodePointValueresetsetCurrentTokentoString

Field Detail

MILESTONESback to summary
private static final String[] MILESTONES

Constructor Detail

MavenVersionIteratorback to summary
pack-priv MavenVersionIterator(final String string)

Method Detail

appendAlphaPartToback to summary
public StringBuilder appendAlphaPartTo(final StringBuilder b) throws IllegalStateException

Overrides io.smallrye.common.version.AbstractVersionIterator.appendAlphaPartTo.

Implements io.smallrye.common.version.VersionIterator.appendAlphaPartTo.

Doc from io.smallrye.common.version.VersionIterator.appendAlphaPartTo.

Append the current alphabetical part to the given string builder. If the iterator is not positioned on an alphabetical part (i.e. isAlphaPart() returns false), then an exception is thrown.

Parameters
b:StringBuilder

the StringBuilder to append

Returns:StringBuilder

the current alphabetical part

Exceptions
IllegalStateException:
if the current token is not an alphabetical part
appendNumberPartToback to summary
public StringBuilder appendNumberPartTo(final StringBuilder target) throws IllegalStateException

Overrides io.smallrye.common.version.AbstractVersionIterator.appendNumberPartTo.

Implements io.smallrye.common.version.VersionIterator.appendNumberPartTo.

Doc from io.smallrye.common.version.VersionIterator.appendNumberPartTo.

Get the current numeric part, appending it to the given builder. If the iterator is not positioned on a numeric part (i.e. isNumberPart() returns false), then an exception is thrown. Any redundant leading zeros are removed.

Parameters
target:StringBuilder

the StringBuilder to append

Returns:StringBuilder

the current numeric part as a String

Exceptions
IllegalStateException:
if the current token is not a numeric part
appendPartToback to summary
public StringBuilder appendPartTo(final StringBuilder target)

Overrides io.smallrye.common.version.AbstractVersionIterator.appendPartTo.

Implements io.smallrye.common.version.VersionIterator.appendPartTo.

Doc from io.smallrye.common.version.VersionIterator.appendPartTo.

Append this version part to the given string builder. This is used to produce a canonical representation of an input string.

Parameters
target:StringBuilder

the string builder (must not be null)

Returns:StringBuilder

the same string builder (not null)

getMilestoneMagnitudeback to summary
pack-priv int getMilestoneMagnitude()
getSeparatorCodePointback to summary
public int getSeparatorCodePoint()

Overrides io.smallrye.common.version.AbstractVersionIterator.getSeparatorCodePoint.

Implements io.smallrye.common.version.VersionIterator.getSeparatorCodePoint.

Doc from io.smallrye.common.version.VersionIterator.getSeparatorCodePoint.

Get the code point of the current separator. If the iterator is not positioned on a non-empty separator (i.e. isNonEmptySeparator() returns false), then an exception is thrown.

Returns:int

the code point of the current separator

hasNextback to summary
public boolean hasNext()

Overrides io.smallrye.common.version.AbstractVersionIterator.hasNext.

Implements io.smallrye.common.version.VersionIterator.hasNext.

Doc from io.smallrye.common.version.AbstractVersionIterator.hasNext.

A basic implementation of VersionIterator#hasNext() which returns true if there are more characters after the current token. Subclasses should generally override this basic behavior but may delegate to this implementation for convenience.

Returns:boolean

true if there are more characters after the current token, false otherwise

isAlphaCodePointback to summary
protected boolean isAlphaCodePoint(final int cp)

Overrides io.smallrye.common.version.AbstractVersionIterator.isAlphaCodePoint.

Doc from io.smallrye.common.version.AbstractVersionIterator.isAlphaCodePoint.

Determine whether the given code point is a valid alpha code point according to the current scheme. This basic implementation returns true for any character whose general category is in the set recognized by Character#isLetter(int). Subclasses may override this method to recognize a different set of alpha code points.

Parameters
cp:int

the code point to test

Returns:boolean

true if the code point is a valid letter, or false otherwise

isAlphaPartback to summary
public boolean isAlphaPart()

Overrides io.smallrye.common.version.AbstractVersionIterator.isAlphaPart.

Implements io.smallrye.common.version.VersionIterator.isAlphaPart.

Doc from io.smallrye.common.version.VersionIterator.isAlphaPart.

Determine if the current token is an alphabetical part.

Returns:boolean

true if the token is an alphabetical part, false otherwise

isEmptySeparatorback to summary
public boolean isEmptySeparator()

Overrides io.smallrye.common.version.AbstractVersionIterator.isEmptySeparator.

Implements io.smallrye.common.version.VersionIterator.isEmptySeparator.

Doc from io.smallrye.common.version.VersionIterator.isEmptySeparator.

Determine if the current token is an empty (or zero-length alphabetical-to-numeric or numeric-to-alphabetical) separator. Note that some version schemes do not have empty separators.

Returns:boolean

true if the token is an empty separator, false otherwise

isNonEmptySeparatorback to summary
public boolean isNonEmptySeparator()

Overrides io.smallrye.common.version.AbstractVersionIterator.isNonEmptySeparator.

Implements io.smallrye.common.version.VersionIterator.isNonEmptySeparator.

Doc from io.smallrye.common.version.VersionIterator.isNonEmptySeparator.

Determine if the current token is a non-empty separator.

Returns:boolean

true if the token is a non-empty separator, false otherwise

isNumberPartback to summary
public boolean isNumberPart()

Overrides io.smallrye.common.version.AbstractVersionIterator.isNumberPart.

Implements io.smallrye.common.version.VersionIterator.isNumberPart.

Doc from io.smallrye.common.version.VersionIterator.isNumberPart.

Determine if the current token is a numeric part.

Returns:boolean

true if the token is a numeric part, false otherwise

isReleaseStringback to summary
pack-priv boolean isReleaseString()
isSeparatorCodePointback to summary
protected boolean isSeparatorCodePoint(final int cp)

Overrides io.smallrye.common.version.AbstractVersionIterator.isSeparatorCodePoint.

Doc from io.smallrye.common.version.AbstractVersionIterator.isSeparatorCodePoint.

Determine whether the given code point is a valid separator according to the current scheme. This basic implementation returns true for '.', '-', '+', and '_'. Subclasses may override this method to recognize a different set of separators.

Parameters
cp:int

the code point to test

Returns:boolean

true if the code point is a separator, or false otherwise

isZeroSegmentback to summary
pack-priv boolean isZeroSegment()
nextback to summary
public void next() throws NoSuchElementException, VersionSyntaxException

Overrides io.smallrye.common.version.AbstractVersionIterator.next.

Implements io.smallrye.common.version.VersionIterator.next.

Doc from io.smallrye.common.version.AbstractVersionIterator.next.

A basic implementation of VersionIterator#next() which uses the methods on this class to establish the next iteration token. This implementation consumes leading zeros from numeric parts but otherwise does not perform any transformations.

Exceptions
NoSuchElementException:
if there are no tokens left to iterate
VersionSyntaxException:
if the version string is unparseable due to syntax error
nextSeparatorIsEmptyback to summary
pack-priv boolean nextSeparatorIsEmpty()
skipTrailerback to summary
pack-priv void skipTrailer(long mark)