@Nullable public T process(@NotNull MavenDomProjectModel projectDom) { MavenDomParent parent = projectDom.getMavenParent(); MavenParentDesc parentDesc = null; if (DomUtil.hasXml(parent)) { String parentGroupId = parent.getGroupId().getStringValue(); String parentArtifactId = parent.getArtifactId().getStringValue(); String parentVersion = parent.getVersion().getStringValue(); String parentRelativePath = parent.getRelativePath().getStringValue(); if (StringUtil.isEmptyOrSpaces(parentRelativePath)) parentRelativePath = "../pom.xml"; MavenId parentId = new MavenId(parentGroupId, parentArtifactId, parentVersion); parentDesc = new MavenParentDesc(parentId, parentRelativePath); } return process( myManager.getGeneralSettings(), MavenDomUtil.getVirtualFile(projectDom), parentDesc); }
private static <T> boolean processProject( MavenDomProjectModel projectDom, MavenProject mavenProjectOrNull, Processor<T> processor, Project project, Function<? super MavenDomProfile, T> domProfileFunction, Function<? super MavenDomProjectModel, T> projectDomFunction) { if (processProfilesXml( MavenDomUtil.getVirtualFile(projectDom), mavenProjectOrNull, processor, project, domProfileFunction)) { return true; } if (processProfiles( projectDom.getProfiles(), mavenProjectOrNull, processor, domProfileFunction)) return true; T t = projectDomFunction.fun(projectDom); return t == null ? false : processor.process(t); }