本文整理匯總了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));
}
}
}
}
}