org.apache.ivy.plugins.version

Class ChainVersionMatcher

public class ChainVersionMatcher extends AbstractVersionMatcher

An implementation of VersionMatcher chaining several version matchers, and implemeting the VersionMatcher interface by returning results from the first matcher in the chain accepting the version.
Constructor Summary
ChainVersionMatcher()
Unique Constructor.
Method Summary
booleanaccept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)
booleanaccept(ModuleRevisionId askedMrid, ModuleDescriptor foundMD)
voidadd(VersionMatcher matcher)
Adds a VersionMatcher to the chain.
intcompare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator staticComparator)
ListgetMatchers()
Returns the list of matchers in the chain.
booleanisDynamic(ModuleRevisionId askedMrid)
booleanneedModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)
voidsetSettings(IvySettings settings)
Sets the settings this matcher will use, and set to the matcher in the chain which implements IvySettingsAware.

Constructor Detail

ChainVersionMatcher

public ChainVersionMatcher()
Unique Constructor.

Method Detail

accept

public boolean accept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)

accept

public boolean accept(ModuleRevisionId askedMrid, ModuleDescriptor foundMD)

add

public void add(VersionMatcher matcher)
Adds a VersionMatcher to the chain.

Parameters: matcher the version matcher to add. Must not be null

compare

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

getMatchers

public List getMatchers()
Returns the list of matchers in the chain.

The list is returned as an unmodifiable view on the actual list of matchers, and will thus reflect futher changes made in the chain.

Returns: the list of matchers in the chain. Is never null.

isDynamic

public boolean isDynamic(ModuleRevisionId askedMrid)

needModuleDescriptor

public boolean needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid)

setSettings

public void setSettings(IvySettings settings)
Sets the settings this matcher will use, and set to the matcher in the chain which implements IvySettingsAware.

Parameters: settings the settings to use in the whole chain. Must not be null.