use of org.jetbrains.idea.maven.dom.model.MavenDomDependencies in project intellij-community by JetBrains.
the class MavenNavigationUtil method findDependency.
@Nullable
public static MavenDomDependency findDependency(@NotNull MavenDomProjectModel projectDom, final String groupId, final String artifactId) {
MavenDomProjectProcessorUtils.SearchProcessor<MavenDomDependency, MavenDomDependencies> processor = new MavenDomProjectProcessorUtils.SearchProcessor<MavenDomDependency, MavenDomDependencies>() {
@Nullable
@Override
protected MavenDomDependency find(MavenDomDependencies element) {
for (MavenDomDependency dependency : element.getDependencies()) {
if (Comparing.equal(groupId, dependency.getGroupId().getStringValue()) && Comparing.equal(artifactId, dependency.getArtifactId().getStringValue())) {
return dependency;
}
}
return null;
}
};
MavenDomProjectProcessorUtils.processDependencies(projectDom, processor);
return processor.getResult();
}
Aggregations