本文整理汇总了Java中org.apache.ivy.util.filter.Filter类的典型用法代码示例。如果您正苦于以下问题:Java Filter类的具体用法?Java Filter怎么用?Java Filter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Filter类属于org.apache.ivy.util.filter包,在下文中一共展示了Filter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDependencies
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public void setDependencies(List<IvyNode> dependencies, Filter<Artifact> artifactFilter) {
this.dependencies = dependencies;
// collect list of artifacts
artifacts = new ArrayList<>();
for (IvyNode dependency : dependencies) {
if (!dependency.isCompletelyEvicted() && !dependency.hasProblem()) {
artifacts.addAll(Arrays.asList(dependency.getSelectedArtifacts(artifactFilter)));
}
// update the configurations reports with the dependencies
// these reports will be completed later with download information, if any
for (String dconf : dependency.getRootModuleConfigurations()) {
ConfigurationResolveReport configurationReport = getConfigurationReport(dconf);
if (configurationReport != null) {
configurationReport.addDependency(dependency);
}
}
}
}
示例2: IvyEventFilter
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public IvyEventFilter(String event, String filterExpression, PatternMatcher matcher) {
this.matcher = (matcher == null) ? ExactPatternMatcher.INSTANCE : matcher;
if (event == null) {
nameFilter = NoFilter.instance();
} else {
final Matcher eventNameMatcher = this.matcher.getMatcher(event);
nameFilter = new Filter<IvyEvent>() {
public boolean accept(IvyEvent e) {
return eventNameMatcher.matches(e.getName());
}
};
}
if (isNullOrEmpty(filterExpression)) {
attFilter = NoFilter.instance();
} else {
attFilter = parseExpression(filterExpression);
}
}
示例3: getConflictManager
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public synchronized ConflictManager getConflictManager(ModuleId moduleId) {
ModuleSettings ms = moduleSettings.getRule(moduleId, new Filter<ModuleSettings>() {
public boolean accept(ModuleSettings o) {
return o.getConflictManager() != null;
}
});
if (ms == null) {
return getDefaultConflictManager();
} else {
ConflictManager cm = getConflictManager(ms.getConflictManager());
if (cm == null) {
throw new IllegalStateException("ivy badly configured: unknown conflict manager "
+ ms.getConflictManager());
}
return cm;
}
}
示例4: determineArtifactsToCopy
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public Map<ArtifactDownloadReport, Set<String>> determineArtifactsToCopy(ModuleId moduleId,
String[] confs, File cache, String destFilePattern, String destIvyPattern,
Filter<Artifact> artifactFilter) throws ParseException, IOException {
return ivy.getRetrieveEngine().determineArtifactsToCopy(
new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()), destFilePattern,
new RetrieveOptions().setConfs(confs).setDestIvyPattern(destIvyPattern)
.setArtifactFilter(artifactFilter));
}
示例5: install
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public ResolveReport install(ModuleRevisionId mrid, String from, String to, boolean transitive,
boolean validate, boolean overwrite, Filter<Artifact> artifactFilter, File cache,
String matcherName) throws IOException {
return ivy.install(mrid, from, to,
new InstallOptions().setTransitive(transitive).setValidate(validate)
.setOverwrite(overwrite).setArtifactFilter(artifactFilter)
.setMatcherName(matcherName));
}
示例6: resolve
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public ResolveReport resolve(ModuleDescriptor md, String[] confs, File cache, Date date,
boolean validate, boolean useCacheOnly, boolean transitive, boolean useOrigin,
boolean download, boolean outputReport, Filter<Artifact> artifactFilter)
throws ParseException, IOException {
return ivy.resolve(md, newResolveOptions(confs, null, cache, date, validate, useCacheOnly,
transitive, useOrigin, download, outputReport, artifactFilter));
}
示例7: newResolveOptions
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
private ResolveOptions newResolveOptions(String[] confs, String revision, File cache, Date date,
boolean validate, boolean useCacheOnly, boolean transitive, boolean useOrigin,
boolean download, boolean outputReport, Filter<Artifact> artifactFilter) {
if (useOrigin) {
ivy.getSettings().useDeprecatedUseOrigin();
}
return new ResolveOptions().setConfs(confs).setRevision(revision).setValidate(validate)
.setUseCacheOnly(useCacheOnly).setTransitive(transitive).setDownload(download)
.setOutputReport(outputReport).setArtifactFilter(artifactFilter);
}
示例8: retrieve
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public int retrieve(ModuleId moduleId, String[] confs, File cache, String destFilePattern,
String destIvyPattern, Filter<Artifact> artifactFilter, boolean sync, boolean useOrigin,
boolean makeSymlinks) {
try {
return ivy.retrieve(new ModuleRevisionId(moduleId, Ivy.getWorkingRevision()),
new RetrieveOptions().setConfs(confs).setDestArtifactPattern(destFilePattern)
.setDestIvyPattern(destIvyPattern)
.setArtifactFilter(artifactFilter).setSync(sync).setUseOrigin(useOrigin)
.setMakeSymlinks(makeSymlinks)).getNbrArtifactsCopied();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例9: getSelectedArtifacts
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
/**
* Returns all the artifacts of this dependency required in the root module configurations in
* which the node is not evicted nor blacklisted
*
* @param artifactFilter Filter
* @return array of {@link Artifact}s
*/
public Artifact[] getSelectedArtifacts(Filter<Artifact> artifactFilter) {
Collection<Artifact> ret = new HashSet<>();
for (String rootModuleConf : getRootModuleConfigurationsSet()) {
if (!isEvicted(rootModuleConf) && !isBlacklisted(rootModuleConf)) {
ret.addAll(Arrays.asList(getArtifacts(rootModuleConf)));
}
}
ret = FilterHelper.filter(ret, artifactFilter);
return ret.toArray(new Artifact[ret.size()]);
}
示例10: getRule
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
private T getRule(Map<String, String> moduleAttributes, Filter<T> filter) {
for (MapMatcher midm : matcherLookup.get(moduleAttributes)) {
T rule = rules.get(midm);
if (filter.accept(rule)) {
return rule;
}
}
return null;
}
示例11: getRules
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
private List<T> getRules(Map<String, String> moduleAttributes, Filter<T> filter) {
List<T> matchingRules = new ArrayList<>();
for (MapMatcher midm : matcherLookup.get(moduleAttributes)) {
T rule = rules.get(midm);
if (filter.accept(rule)) {
matchingRules.add(rule);
}
}
return matchingRules;
}
示例12: getResolverName
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public synchronized String getResolverName(ModuleRevisionId mrid) {
ModuleSettings ms = moduleSettings.getRule(mrid, new Filter<ModuleSettings>() {
public boolean accept(ModuleSettings o) {
return o.getResolverName() != null;
}
});
return ms == null ? defaultResolverName : ms.getResolverName();
}
示例13: getDefaultBranch
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public synchronized String getDefaultBranch(ModuleId moduleId) {
ModuleSettings ms = moduleSettings.getRule(moduleId, new Filter<ModuleSettings>() {
public boolean accept(ModuleSettings o) {
return o.getBranch() != null;
}
});
return ms == null ? getDefaultBranch() : ms.getBranch();
}
示例14: getResolveMode
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
public synchronized String getResolveMode(ModuleId moduleId) {
ModuleSettings ms = moduleSettings.getRule(moduleId, new Filter<ModuleSettings>() {
public boolean accept(ModuleSettings o) {
return o.getResolveMode() != null;
}
});
return ms == null ? getDefaultResolveMode() : ms.getResolveMode();
}
示例15: acceptNone
import org.apache.ivy.util.filter.Filter; //导入依赖的package包/类
private Filter<String> acceptNone() {
return new Filter<String>() {
public boolean accept(String o) {
return false;
}
public String toString() {
return "AcceptNone";
}
};
}