当前位置: 首页>>代码示例>>Java>>正文


Java ReflectedProject类代码示例

本文整理汇总了Java中com.intellij.lang.ant.ReflectedProject的典型用法代码示例。如果您正苦于以下问题:Java ReflectedProject类的具体用法?Java ReflectedProject怎么用?Java ReflectedProject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReflectedProject类属于com.intellij.lang.ant包,在下文中一共展示了ReflectedProject类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProperties

import com.intellij.lang.ant.ReflectedProject; //导入依赖的package包/类
private Map<String, String> getProperties() {
  Map<String, String> properties = myProperties;
  if (properties == null) {
    final ReflectedProject reflected = ReflectedProject.getProject(getClassLoader());
    Map<String, String> externals = Collections.emptyMap();
    final PsiFile containingFile = getXmlTag().getContainingFile();
    if (containingFile != null) {
      final AntBuildFileImpl buildFile = (AntBuildFileImpl)AntConfigurationBase.getInstance(containingFile.getProject()).getAntBuildFile(containingFile);
      if (buildFile != null) {
        externals = buildFile.getExternalProperties();
      }
    }
    myProperties = (properties = loadPredefinedProperties(reflected.getProperties(), externals));
  }
  return properties;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AntDomProject.java

示例2: AntClassLoader

import com.intellij.lang.ant.ReflectedProject; //导入依赖的package包/类
public AntClassLoader(ArrayList<URL> urls) {
  super(build().urls(urls).allowUnescaped().noPreload());
  myFuture = ApplicationManager.getApplication().executeOnPooledThread(new Callable<Map<String, Class>>() {
    @Override
    public Map<String, Class> call() throws Exception {
      try {
        final ReflectedProject antProject = ReflectedProject.getProject(AntClassLoader.this);
        final Map<String, Class> result = new HashMap<String, Class>();
        if (antProject != null) {
          final Map<String, Class> taskDefinitions = antProject.getTaskDefinitions();
          if (taskDefinitions != null) {
            result.putAll(taskDefinitions);
          }
          final Map<String, Class> dataTypeDefinitions = antProject.getDataTypeDefinitions();
          if (dataTypeDefinitions != null) {
            result.putAll(dataTypeDefinitions);
          }
        }
        return result;
      }
      catch (Exception e) {
        LOG.error(e);
        return null;
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:AntTasksProvider.java

示例3: AntClassLoader

import com.intellij.lang.ant.ReflectedProject; //导入依赖的package包/类
public AntClassLoader(ArrayList<URL> urls) {
  super(urls, null, false, false, true, false);
  myFuture = ApplicationManager.getApplication().executeOnPooledThread(new Callable<Map<String, Class>>() {
    @Override
    public Map<String, Class> call() throws Exception {
      try {
        final ReflectedProject antProject = ReflectedProject.getProject(AntClassLoader.this);
        final Map<String, Class> result = new HashMap<String, Class>();
        if (antProject != null) {
          final Map<String, Class> taskDefinitions = antProject.getTaskDefinitions();
          if (taskDefinitions != null) {
            result.putAll(taskDefinitions);
          }
          final Map<String, Class> dataTypeDefinitions = antProject.getDataTypeDefinitions();
          if (dataTypeDefinitions != null) {
            result.putAll(dataTypeDefinitions);
          }
        }
        return result;
      }
      catch (Exception e) {
        LOG.error(e);
        return null;
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:AntTasksProvider.java

示例4: visitScriptDef

import com.intellij.lang.ant.ReflectedProject; //导入依赖的package包/类
public void visitScriptDef(AntDomScriptDef scriptdef) {
  final String customTagName = scriptdef.getName().getStringValue();
  if (customTagName != null) {
    final String nsUri = scriptdef.getUri().getStringValue();
    final ClassLoader classLoader = getClassLoader(scriptdef, myAntProject);
    // register the scriptdef
    addCustomDefinition(scriptdef, customTagName, nsUri, ClassProvider.EMPTY);
    // registering nested elements
    ReflectedProject reflectedProject = null;
    for (AntDomScriptdefElement element : scriptdef.getScriptdefElements()) {
      final String customSubTagName = element.getName().getStringValue();
      if (customSubTagName != null) {
        final String classname = element.getClassname().getStringValue();
        if (classname != null) {
          addCustomDefinition(element, customTagName, nsUri, ClassProvider.create(classname, classLoader));
        }
        else {
          Class clazz = null;
          final String typeName = element.getElementType().getStringValue();
          if (typeName != null) {
            clazz = lookupClass(new XmlName(typeName));
            if (clazz == null) {
              if (reflectedProject == null) { // lazy init
                reflectedProject = ReflectedProject.getProject(myAntProject.getClassLoader());
              }
              final Hashtable<String, Class> coreTasks = reflectedProject.getTaskDefinitions();
              if (coreTasks != null) {
                clazz = coreTasks.get(typeName);
              }
              if (clazz == null) {
                final Hashtable<String, Class> coreTypes = reflectedProject.getDataTypeDefinitions();
                if (coreTypes != null) {
                  clazz = coreTypes.get(typeName);
                }
              }
            }
          }
          addCustomDefinition(element, customSubTagName, nsUri, ClassProvider.create(clazz));
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:CustomAntElementsRegistry.java


注:本文中的com.intellij.lang.ant.ReflectedProject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。