本文整理汇总了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;
}
示例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;
}
}
});
}
示例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;
}
}
});
}
示例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));
}
}
}
}
}