org.apache.ivy.plugins.version

Class VersionRangeMatcher

public class VersionRangeMatcher extends AbstractVersionMatcher

Matches version ranges: [1.0,2.0] matches all versions greater or equal to 1.0 and lower or equal to 2.0 [1.0,2.0[ matches all versions greater or equal to 1.0 and lower than 2.0 ]1.0,2.0] matches all versions greater than 1.0 and lower or equal to 2.0 ]1.0,2.0[ matches all versions greater than 1.0 and lower than 2.0 [1.0,) matches all versions greater or equal to 1.0 ]1.0,) matches all versions greater than 1.0 (,2.0] matches all versions lower or equal to 2.0 (,2.0[ matches all versions lower than 2.0 This class uses a latest strategy to compare revisions. If none is set, it uses the default one of the ivy instance set through setIvy(). If neither a latest strategy nor a ivy instance is set, an IllegalStateException will be thrown when calling accept(). Note that it can't work with latest time strategy, cause no time is known for the limits of the range. Therefore only purely revision based LatestStrategy can be used.
Constructor Summary
VersionRangeMatcher()
VersionRangeMatcher(String name)
VersionRangeMatcher(String name, LatestStrategy strategy)
Method Summary
booleanaccept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)
intcompare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator staticComparator)
LatestStrategygetLatestStrategy()
booleanisDynamic(ModuleRevisionId askedMrid)
voidsetLatest(String latestStrategyName)
voidsetLatestStrategy(LatestStrategy latestStrategy)

Constructor Detail

VersionRangeMatcher

public VersionRangeMatcher()

VersionRangeMatcher

public VersionRangeMatcher(String name)

VersionRangeMatcher

public VersionRangeMatcher(String name, LatestStrategy strategy)

Method Detail

accept

public boolean accept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)

compare

public int compare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator staticComparator)

getLatestStrategy

public LatestStrategy getLatestStrategy()

isDynamic

public boolean isDynamic(ModuleRevisionId askedMrid)

setLatest

public void setLatest(String latestStrategyName)

setLatestStrategy

public void setLatestStrategy(LatestStrategy latestStrategy)