Package org.apache.ivy.plugins.resolver
Class AbstractPatternsBasedResolver
- java.lang.Object
-
- org.apache.ivy.plugins.resolver.AbstractResolver
-
- org.apache.ivy.plugins.resolver.BasicResolver
-
- org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
-
- All Implemented Interfaces:
Validatable,DependencyResolver,HasLatestStrategy
- Direct Known Subclasses:
RepositoryResolver
public abstract class AbstractPatternsBasedResolver extends BasicResolver
-
-
Field Summary
-
Fields inherited from class org.apache.ivy.plugins.resolver.BasicResolver
DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED
-
-
Constructor Summary
Constructors Constructor Description AbstractPatternsBasedResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddArtifactPattern(java.lang.String pattern)voidaddConfiguredArtifact(IvyPattern p)voidaddConfiguredIvy(IvyPattern p)voidaddIvyPattern(java.lang.String pattern)example of pattern : ~/Workspace/[module]/[module].ivy.xmlprotected ModuleRevisionIdconvertM2IdForResourceSearch(ModuleRevisionId mrid)protected java.lang.StringconvertM2OrganizationForResourceSearch(java.lang.String org)protected ModuleRevisionIdconvertM2ResourceSearchIdToNormal(ModuleRevisionId mrid)protected voidconvertM2TokenValuesForResourceSearch(java.util.Map tokenValues)voiddumpSettings()protected abstract booleanexist(java.lang.String path)protected java.util.CollectionfindArtifactNames(java.util.Map tokenValues, java.lang.String token)ResolvedResourcefindArtifactRef(Artifact artifact, java.util.Date date)ResolvedResourcefindIvyFileRef(DependencyDescriptor dd, ResolveData data)Finds the module descriptor for the specified DependencyDescriptor.protected java.util.CollectionfindIvyNames(java.util.Map tokenValues, java.lang.String token)protected java.util.CollectionfindNames(java.util.Map tokenValues, java.lang.String token)ResolvedResourcefindResource(ResolvedResource[] rress, ResourceMDParser rmdparser, ModuleRevisionId mrid, java.util.Date date)When the resolver has many choices, this function helps choosing oneprotected abstract ResolvedResourcefindResourceUsingPattern(ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)protected ResolvedResourcefindResourceUsingPatterns(ModuleRevisionId moduleRevision, java.util.List patternList, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)protected voidfindTokenValues(java.util.Collection names, java.util.List patterns, java.util.Map tokenValues, java.lang.String token)java.util.ListgetArtifactPatterns()java.util.ListgetIvyPatterns()protected java.lang.StringgetModuleDescriptorExtension()booleanisM2compatible()java.util.Map[]listTokenValues(java.lang.String[] tokens, java.util.Map criteria)Same asDependencyResolver.listTokenValues(String, Map)but more generic.protected abstract java.lang.String[]listTokenValues(java.lang.String pattern, java.lang.String token)protected voidsetArtifactPatterns(java.util.List patterns)protected voidsetIvyPatterns(java.util.List patterns)voidsetM2compatible(boolean compatible)-
Methods inherited from class org.apache.ivy.plugins.resolver.BasicResolver
acceptLatest, checkModuleDescriptorRevision, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, download, exists, filterNames, findFirstArtifactRef, get, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getDependency, getPublicationDate, getResource, getRMDParser, getWorkspaceName, isAllownomd, isCheckconsistency, isEnvDependent, isForce, listModules, listOrganisations, listRevisions, listTokenValues, locate, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toString
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractResolver
abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTypeName, hidePassword, isAfter, isValidate, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setName, setNamespace, setRepositoryCacheManager, setSettings, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ivy.plugins.resolver.DependencyResolver
publish
-
-
-
-
Method Detail
-
findIvyFileRef
public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data)
Description copied from interface:DependencyResolverFinds the module descriptor for the specified DependencyDescriptor. If this resolver can't find the module descriptor, null is returned.- Parameters:
dd- the dependency descriptordata- the resolve data- Returns:
- the module descriptor, or null
-
findArtifactRef
public ResolvedResource findArtifactRef(Artifact artifact, java.util.Date date)
- Specified by:
findArtifactRefin classBasicResolver
-
findResource
public ResolvedResource findResource(ResolvedResource[] rress, ResourceMDParser rmdparser, ModuleRevisionId mrid, java.util.Date date)
Description copied from class:BasicResolverWhen the resolver has many choices, this function helps choosing one- Overrides:
findResourcein classBasicResolver- Parameters:
rress- the list of resolved resource which the resolver found to fit the requirementrmdparser- the parser of module descriptormrid- the module being resolveddate- the current date- Returns:
- the selected resource
-
findResourceUsingPatterns
protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevision, java.util.List patternList, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)
-
findResourceUsingPattern
protected abstract ResolvedResource findResourceUsingPattern(ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)
-
findNames
protected java.util.Collection findNames(java.util.Map tokenValues, java.lang.String token)- Specified by:
findNamesin classBasicResolver
-
findIvyNames
protected java.util.Collection findIvyNames(java.util.Map tokenValues, java.lang.String token)
-
findArtifactNames
protected java.util.Collection findArtifactNames(java.util.Map tokenValues, java.lang.String token)
-
listTokenValues
public java.util.Map[] listTokenValues(java.lang.String[] tokens, java.util.Map criteria)Description copied from interface:DependencyResolverSame asDependencyResolver.listTokenValues(String, Map)but more generic.- Specified by:
listTokenValuesin interfaceDependencyResolver- Overrides:
listTokenValuesin classAbstractResolver- Parameters:
tokens- the tokens of the querycriteria- the token which have values- Returns:
- the list of token values (Map
[]), must not be null
-
getModuleDescriptorExtension
protected java.lang.String getModuleDescriptorExtension()
-
listTokenValues
protected abstract java.lang.String[] listTokenValues(java.lang.String pattern, java.lang.String token)
-
exist
protected abstract boolean exist(java.lang.String path)
-
findTokenValues
protected void findTokenValues(java.util.Collection names, java.util.List patterns, java.util.Map tokenValues, java.lang.String token)
-
addIvyPattern
public void addIvyPattern(java.lang.String pattern)
example of pattern : ~/Workspace/[module]/[module].ivy.xml- Parameters:
pattern-
-
addArtifactPattern
public void addArtifactPattern(java.lang.String pattern)
-
getIvyPatterns
public java.util.List getIvyPatterns()
-
getArtifactPatterns
public java.util.List getArtifactPatterns()
-
setIvyPatterns
protected void setIvyPatterns(java.util.List patterns)
-
setArtifactPatterns
protected void setArtifactPatterns(java.util.List patterns)
-
addConfiguredIvy
public void addConfiguredIvy(IvyPattern p)
-
addConfiguredArtifact
public void addConfiguredArtifact(IvyPattern p)
-
dumpSettings
public void dumpSettings()
- Specified by:
dumpSettingsin interfaceDependencyResolver- Overrides:
dumpSettingsin classAbstractResolver
-
isM2compatible
public boolean isM2compatible()
-
setM2compatible
public void setM2compatible(boolean compatible)
-
convertM2ResourceSearchIdToNormal
protected ModuleRevisionId convertM2ResourceSearchIdToNormal(ModuleRevisionId mrid)
-
convertM2IdForResourceSearch
protected ModuleRevisionId convertM2IdForResourceSearch(ModuleRevisionId mrid)
-
convertM2OrganizationForResourceSearch
protected java.lang.String convertM2OrganizationForResourceSearch(java.lang.String org)
-
convertM2TokenValuesForResourceSearch
protected void convertM2TokenValuesForResourceSearch(java.util.Map tokenValues)
-
-