Java 类com.intellij.lang.ant.AntIntrospector 实例源码

项目:intellij-ce-playground    文件:AntBuilderMethod.java   
public boolean processNestedElements(PsiScopeProcessor processor) {
  final AntIntrospector introspector = AntDomExtender.getIntrospector(myAntClass);
  if (introspector != null) {
    String expectedName = ResolveUtil.getNameHint(processor);
    final PsiType stringType = getParameterList().getParameters()[1].getType();
    final PsiType closureType = getParameterList().getParameters()[2].getType();

    for (String name : Collections.list(introspector.getNestedElements())) {
      if (expectedName == null || expectedName.equals(name)) {
        final AntBuilderMethod method = new AntBuilderMethod(myPlace, name, closureType, introspector.getElementType(name),
                                                             stringType);
        if (!processor.execute(method, ResolveState.initial())) return false;
      }
    }
  }
  return true;
}
项目:tools-idea    文件:AntBuilderMethod.java   
public boolean processNestedElements(PsiScopeProcessor processor) {
  final AntIntrospector introspector = AntDomExtender.getIntrospector(myAntClass);
  if (introspector != null) {
    String expectedName = ResolveUtil.getNameHint(processor);
    final PsiType stringType = getParameterList().getParameters()[1].getType();
    final PsiType closureType = getParameterList().getParameters()[2].getType();

    for (String name : Collections.list(introspector.getNestedElements())) {
      if (expectedName == null || expectedName.equals(name)) {
        final AntBuilderMethod method = new AntBuilderMethod(myPlace, name, closureType, introspector.getElementType(name),
                                                             stringType);
        if (!processor.execute(method, ResolveState.initial())) return false;
      }
    }
  }
  return true;
}
项目:intellij-ce-playground    文件:AntDomExtender.java   
@Nullable
public static AntIntrospector getIntrospector(Class c) {
  try {
    return AntIntrospector.getInstance(c);
  }
  catch (Throwable ignored) {
  }
  return null;
}
项目:intellij-ce-playground    文件:AntDomExtender.java   
private List<AbstractIntrospector> getContexts() {
  if (myContexts != null) {
    return myContexts;
  }
  final List<AbstractIntrospector> parents = new ArrayList<AbstractIntrospector>();
  final AntDomMacroDef macroDef = myElement.getParentOfType(AntDomMacroDef.class, true);
  if (macroDef != null) {
    final AntDomSequentialTask body = macroDef.getMacroBody();
    if (body != null) {
      body.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomCustomElement(AntDomCustomElement custom) {
          if (myElement.equals(custom.getDeclaringElement())) {
            final AntDomElement parent = custom.getParentOfType(AntDomElement.class, true);
            if (parent != null) {
              final Class type = parent.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY);
              if (type != null) {
                final AntIntrospector antIntrospector = AntIntrospector.getInstance(type);
                if (antIntrospector != null) {
                  parents.add(new ClassIntrospectorAdapter(antIntrospector));
                }
              }
            }
          }
        }
      });
    }
  }
  return myContexts = parents;
}
项目:tools-idea    文件:AntDomExtender.java   
@Nullable
public static AntIntrospector getIntrospector(Class c) {
  try {
    return AntIntrospector.getInstance(c);
  }
  catch (Throwable ignored) {
  }
  return null;
}
项目:tools-idea    文件:AntDomExtender.java   
private List<AbstractIntrospector> getContexts() {
  if (myContexts != null) {
    return myContexts;
  }
  final List<AbstractIntrospector> parents = new ArrayList<AbstractIntrospector>();
  final AntDomMacroDef macroDef = myElement.getParentOfType(AntDomMacroDef.class, true);
  if (macroDef != null) {
    final AntDomSequentialTask body = macroDef.getMacroBody();
    if (body != null) {
      body.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomCustomElement(AntDomCustomElement custom) {
          if (myElement.equals(custom.getDeclaringElement())) {
            final AntDomElement parent = custom.getParentOfType(AntDomElement.class, true);
            if (parent != null) {
              final Class type = parent.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY);
              if (type != null) {
                final AntIntrospector antIntrospector = AntIntrospector.getInstance(type);
                if (antIntrospector != null) {
                  parents.add(new ClassIntrospectorAdapter(antIntrospector));
                }
              }
            }
          }
        }
      });
    }
  }
  return myContexts = parents;
}
项目:consulo-apache-ant    文件:AntDomExtender.java   
@Nullable
public static AntIntrospector getIntrospector(Class c) {
  try {
    return AntIntrospector.getInstance(c);
  }
  catch (Throwable ignored) {
  }
  return null;
}
项目:consulo-apache-ant    文件:AntDomExtender.java   
private List<AbstractIntrospector> getContexts() {
  if (myContexts != null) {
    return myContexts;
  }
  final List<AbstractIntrospector> parents = new ArrayList<AbstractIntrospector>();
  final AntDomMacroDef macroDef = myElement.getParentOfType(AntDomMacroDef.class, true);
  if (macroDef != null) {
    final AntDomSequentialTask body = macroDef.getMacroBody();
    if (body != null) {
      body.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomCustomElement(AntDomCustomElement custom) {
          if (myElement.equals(custom.getDeclaringElement())) {
            final AntDomElement parent = custom.getParentOfType(AntDomElement.class, true);
            if (parent != null) {
              final Class type = parent.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY);
              if (type != null) {
                final AntIntrospector antIntrospector = AntIntrospector.getInstance(type);
                if (antIntrospector != null) {
                  parents.add(new ClassIntrospectorAdapter(antIntrospector));
                }
              }
            }
          }
        }
      });
    }
  }
  return myContexts = parents;
}
项目:intellij-ce-playground    文件:AntDomExtender.java   
private ClassIntrospectorAdapter(AntIntrospector introspector) {
  this(introspector, null, null);
}
项目:intellij-ce-playground    文件:AntDomExtender.java   
public ClassIntrospectorAdapter(AntIntrospector introspector, Map<String, Class> coreTaskDefs, Map<String, Class> coreTypeDefs) {
  myIntrospector = introspector;
  myCoreTaskDefs = coreTaskDefs != null? coreTaskDefs : Collections.<String, Class>emptyMap();
  myCoreTypeDefs = coreTypeDefs != null? coreTypeDefs : Collections.<String, Class>emptyMap();
}
项目:tools-idea    文件:AntDomExtender.java   
private ClassIntrospectorAdapter(AntIntrospector introspector) {
  this(introspector, null, null);
}
项目:tools-idea    文件:AntDomExtender.java   
public ClassIntrospectorAdapter(AntIntrospector introspector, Map<String, Class> coreTaskDefs, Map<String, Class> coreTypeDefs) {
  myIntrospector = introspector;
  myCoreTaskDefs = coreTaskDefs != null? coreTaskDefs : Collections.<String, Class>emptyMap();
  myCoreTypeDefs = coreTypeDefs != null? coreTypeDefs : Collections.<String, Class>emptyMap();
}
项目:consulo-apache-ant    文件:AntDomExtender.java   
private ClassIntrospectorAdapter(AntIntrospector introspector) {
  this(introspector, null, null);
}
项目:consulo-apache-ant    文件:AntDomExtender.java   
public ClassIntrospectorAdapter(AntIntrospector introspector, Map<String, Class> coreTaskDefs, Map<String, Class> coreTypeDefs) {
  myIntrospector = introspector;
  myCoreTaskDefs = coreTaskDefs != null? coreTaskDefs : Collections.<String, Class>emptyMap();
  myCoreTypeDefs = coreTypeDefs != null? coreTypeDefs : Collections.<String, Class>emptyMap();
}