Java 类com.intellij.lang.ant.dom.AntDomRecursiveVisitor 实例源码

项目:intellij-ce-playground    文件:AntBuildTargetImpl.java   
@Nullable
public BuildTask findTask(final String taskName) {
  final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(myFile);
  final AntDomProject domProject = AntSupport.getAntDomProject(psiFile);
  if (domProject != null) {
    final AntDomTarget antTarget = domProject.findDeclaredTarget(myName);
    if (antTarget != null) {
      final Ref<AntDomElement> result = new Ref<AntDomElement>(null);
      antTarget.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomElement(AntDomElement element) {
          if (result.get() != null) {
            return;
          }
          if (element.isTask() && taskName.equals(element.getXmlElementName())) {
            result.set(element);
            return;
          }
          super.visitAntDomElement(element);
        }
      });
      final AntDomElement task = result.get();
      if (task != null) {
        return new BuildTask(this, task);
      }
    }
  }
  return null;
}
项目:tools-idea    文件:AntBuildTargetImpl.java   
@Nullable
public BuildTask findTask(final String taskName) {
  final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(myFile);
  final AntDomProject domProject = AntSupport.getAntDomProject(psiFile);
  if (domProject != null) {
    final AntDomTarget antTarget = domProject.findDeclaredTarget(myName);
    if (antTarget != null) {
      final Ref<AntDomElement> result = new Ref<AntDomElement>(null);
      antTarget.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomElement(AntDomElement element) {
          if (result.get() != null) {
            return;
          }
          if (element.isTask() && taskName.equals(element.getXmlElementName())) {
            result.set(element);
            return;
          }
          super.visitAntDomElement(element);
        }
      });
      final AntDomElement task = result.get();
      if (task != null) {
        return new BuildTask(this, task);
      }
    }
  }
  return null;
}
项目:consulo-apache-ant    文件:AntBuildTargetImpl.java   
@Nullable
public BuildTask findTask(final String taskName) {
  final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(myFile);
  final AntDomProject domProject = AntSupport.getAntDomProject(psiFile);
  if (domProject != null) {
    final AntDomTarget antTarget = domProject.findDeclaredTarget(myName);
    if (antTarget != null) {
      final Ref<AntDomElement> result = new Ref<AntDomElement>(null);
      antTarget.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomElement(AntDomElement element) {
          if (result.get() != null) {
            return;
          }
          if (element.isTask() && taskName.equals(element.getXmlElementName())) {
            result.set(element);
            return;
          }
          super.visitAntDomElement(element);
        }
      });
      final AntDomElement task = result.get();
      if (task != null) {
        return new BuildTask(this, task);
      }
    }
  }
  return null;
}