Class AbstractVersionMatcher
java.lang.Object
org.apache.ivy.plugins.version.AbstractVersionMatcher
- All Implemented Interfaces:
IvySettingsAware, VersionMatcher
- Direct Known Subclasses:
ChainVersionMatcher, ExactVersionMatcher, LatestVersionMatcher, MavenTimedSnapshotVersionMatcher, PatternVersionMatcher, SubVersionMatcher, VersionRangeMatcher
public abstract class AbstractVersionMatcher
extends Object
implements VersionMatcher, IvySettingsAware
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(ModuleRevisionId askedMrid, ModuleDescriptor foundMD) Indicates if this version matcher considers that the module found matches the asked one.intcompare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator<ModuleRevisionId> staticComparator) This method should be overridden in most cases, because it uses the default contract to return 1 when it's not possible to know which revision is greater.getName()Returns the version matcher name identifying this version matcherbooleanneedModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) Indicates if this VersionMatcher needs module descriptors to determine if a module revision matches the asked one.voidvoidsetSettings(IvySettings settings) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface VersionMatcher
accept, isDynamic
-
Constructor Details
-
AbstractVersionMatcher
public AbstractVersionMatcher() -
AbstractVersionMatcher
-
-
Method Details
-
getName
Description copied from interface:VersionMatcherReturns the version matcher name identifying this version matcher- Specified by:
getNamein interfaceVersionMatcher- Returns:
- the version matcher name identifying this version matcher
-
setName
-
needModuleDescriptor
Description copied from interface:VersionMatcherIndicates if this VersionMatcher needs module descriptors to determine if a module revision matches the asked one. Note that returning true in this method may imply big performance issues.- Specified by:
needModuleDescriptorin interfaceVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMrid- ModuleRevisionId- Returns:
- boolean
-
accept
Description copied from interface:VersionMatcherIndicates if this version matcher considers that the module found matches the asked one. This method can be called even needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) returns false, so it is required to implement it in any case, a usual default implementation being: return accept(askedMrid, foundMD.getResolvedModuleRevisionId());- Specified by:
acceptin interfaceVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMD- ModuleDescriptor- Returns:
- boolean
-
compare
public int compare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator<ModuleRevisionId> staticComparator) This method should be overridden in most cases, because it uses the default contract to return 1 when it's not possible to know which revision is greater.- Specified by:
comparein interfaceVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMrid- ModuleRevisionIdstaticComparator- Comparator- Returns:
- int
-
toString
-
getSettings
-
setSettings
- Specified by:
setSettingsin interfaceIvySettingsAware
-