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 and Description
`AbstractPatternsBasedResolver()`

### Method Summary

Methods
`void` `addArtifactPattern(java.lang.String pattern)`
`void` `addConfiguredArtifact(IvyPattern p)`
`void` `addConfiguredIvy(IvyPattern p)`
`void` `addIvyPattern(java.lang.String pattern)` example of pattern : ~/Workspace/[module]/[module].ivy.xml
`protected ModuleRevisionId` `convertM2IdForResourceSearch(ModuleRevisionId mrid)`
`protected java.lang.String` `convertM2OrganizationForResourceSearch(java.lang.String org)`
`protected ModuleRevisionId` `convertM2ResourceSearchIdToNormal(ModuleRevisionId mrid)`
`protected void` `convertM2TokenValuesForResourceSearch(java.util.Map tokenValues)`
`void` `dumpSettings()`
`protected abstract boolean` `exist(java.lang.String path)`
`protected java.util.Collection` `findArtifactNames(java.util.Map tokenValues, java.lang.String token)`
`ResolvedResource` `findArtifactRef(Artifact artifact, java.util.Date date)`
`ResolvedResource` `findIvyFileRef(DependencyDescriptor dd, ResolveData data)` Finds the module descriptor for the specified `DependencyDescriptor`.
`protected java.util.Collection` `findIvyNames(java.util.Map tokenValues, java.lang.String token)`
`protected java.util.Collection` `findNames(java.util.Map tokenValues, java.lang.String token)`
`ResolvedResource` `findResource(ResolvedResource[] rress, ResourceMDParser rmdparser, ModuleRevisionId mrid, java.util.Date date)` When the resolver has many choices, this function helps choosing one
`protected abstract ResolvedResource` `findResourceUsingPattern(ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)`
`protected ResolvedResource` `findResourceUsingPatterns(ModuleRevisionId moduleRevision, java.util.List patternList, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)`
`protected void` `findTokenValues(java.util.Collection names, java.util.List patterns, java.util.Map tokenValues, java.lang.String token)`
`java.util.List` `getArtifactPatterns()`
`java.util.List` `getIvyPatterns()`
`protected java.lang.String` `getModuleDescriptorExtension()`
`boolean` `isM2compatible()`
`java.util.Map[]` `listTokenValues(java.lang.String[] tokens, java.util.Map criteria)` Same as `DependencyResolver.listTokenValues(String, Map)` but more generic.
`protected abstract java.lang.String[]` `listTokenValues(java.lang.String pattern, java.lang.String token)`
`protected void` `setArtifactPatterns(java.util.List patterns)`
`protected void` `setIvyPatterns(java.util.List patterns)`
`void` `setM2compatible(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`

### Constructor Detail

#### AbstractPatternsBasedResolver

    public AbstractPatternsBasedResolver()

### Method Detail

#### findIvyFileRef

    public ResolvedResource findIvyFileRef(DependencyDescriptor dd,
                                  ResolveData data)

Description copied from interface: `DependencyResolver`
Finds the module descriptor for the specified `DependencyDescriptor`. If this resolver can't find the module descriptor, `null` is returned.

Parameters:
  `dd` - the dependency descriptor
  `data` - the resolve data
Returns:
  the module descriptor, or `null`

#### findArtifactRef

    public ResolvedResource findArtifactRef(Artifact artifact,
                                   java.util.Date date)

Specified by:
  `findArtifactRef` in class `BasicResolver`

#### findResource

    public ResolvedResource findResource(ResolvedResource[] rress,
                                ResourceMDParser rmdparser,
                                ModuleRevisionId mrid,
                                java.util.Date date)

Description copied from class: `BasicResolver`
When the resolver has many choices, this function helps choosing one

Overrides:
  `findResource` in class `BasicResolver`
Parameters:
  `rress` - the list of resolved resource which the resolver found to fit the requirement
  `rmdparser` - the parser of module descriptor
  `mrid` - the module being resolved
  `date` - 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:
  `findNames` in class `BasicResolver`

#### 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: `DependencyResolver`
Same as `DependencyResolver.listTokenValues(String, Map)` but more generic.

Specified by:
  `listTokenValues` in interface `DependencyResolver`
Overrides:
  `listTokenValues` in class `AbstractResolver`
Parameters:
  `tokens` - the tokens of the query
  `criteria` - the token which have values
Returns:
  the list of token values (Map<Strin, String>[]), 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:
  `dumpSettings` in interface `DependencyResolver`
Overrides:
  `dumpSettings` in class `AbstractResolver`

#### 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)