本文整理汇总了Java中com.intellij.xml.XmlSchemaProvider类的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaProvider类的具体用法?Java XmlSchemaProvider怎么用?Java XmlSchemaProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaProvider类属于com.intellij.xml包,在下文中一共展示了XmlSchemaProvider类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDevKitConfig
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
private boolean isDevKitConfig(XmlTag tag, XmlFile baseFile) {
Module module = ModuleUtilCore.findModuleForPsiElement(baseFile);
String namespace = tag.getNamespace();
List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(baseFile);
for (XmlSchemaProvider provider : providers) {
Set<String> locations = provider.getLocations(namespace, baseFile);
for (String location : locations) {
XmlFile schema = provider.getSchema(location, module, baseFile);
if (schema != null) {
String schemaFile = schema.getText();
if (schemaFile.contains("http://www.mulesoft.org/schema/mule/devkit")) {
return true;
}
}
}
}
return false;
}
示例2: suggestPrefix
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace)
{
if(namespace == null)
{
return null;
}
for(XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file))
{
String prefix = provider.getDefaultPrefix(namespace, file);
if(prefix != null)
{
return prefix;
}
}
return null;
}
示例3: suggestPrefix
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace) {
if (namespace == null) {
return null;
}
for (XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file)) {
String prefix = provider.getDefaultPrefix(namespace, file);
if (prefix != null) {
return prefix;
}
}
return null;
}
示例4: setUp
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
final LocalInspectionTool[] tools = configureLocalInspectionTools();
CodeInsightTestFixtureImpl.configureInspections(tools, getProject(), Collections.<String>emptyList(),
getTestRootDisposable());
DaemonCodeAnalyzerImpl daemonCodeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject());
daemonCodeAnalyzer.prepareForTest();
final StartupManagerImpl startupManager = (StartupManagerImpl)StartupManagerEx.getInstanceEx(getProject());
startupManager.runStartupActivities();
startupManager.startCacheUpdate();
startupManager.runPostStartupActivities();
DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(false);
if (isPerformanceTest()) {
IntentionManager.getInstance().getAvailableIntentionActions(); // hack to avoid slowdowns in PyExtensionFactory
PathManagerEx.getTestDataPath(); // to cache stuff
ReferenceProvidersRegistry.getInstance(); // pre-load tons of classes
InjectedLanguageManager.getInstance(getProject()); // zillion of Dom Sem classes
LanguageAnnotators.INSTANCE.allForLanguage(JavaLanguage.INSTANCE); // pile of annotator classes loads
LanguageAnnotators.INSTANCE.allForLanguage(StdLanguages.XML);
ProblemHighlightFilter.EP_NAME.getExtensions();
Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
Extensions.getExtensions(XmlSchemaProvider.EP_NAME);
Extensions.getExtensions(XmlFileNSInfoProvider.EP_NAME);
Extensions.getExtensions(ExternalAnnotatorsFilter.EXTENSION_POINT_NAME);
Extensions.getExtensions(IndexPatternBuilder.EP_NAME);
}
}
示例5: getResourceLocation
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version) {
final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
if (schema != null) {
return schema;
}
final String location = getResourceLocation(url, version, baseFile.getProject());
return XmlUtil.findXmlFile(baseFile, location);
}
示例6: suggestPrefix
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace) {
if (namespace == null) {
return null;
}
for (XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file)) {
String prefix = provider.getDefaultPrefix(namespace, file);
if (prefix != null) {
return prefix;
}
}
return null;
}
示例7: getUnboundNamespaceForPrefix
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
/** Given a prefix in a file and a set of candidate namespaces, returns the namespace that matches the prefix (if any)
* as determined by the {@link XmlSchemaProvider#getDefaultPrefix(String, XmlFile)}
* implementations */
@Nullable
public static String getUnboundNamespaceForPrefix(String prefix, XmlFile xmlFile, Set<String> namespaces) {
final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(xmlFile);
for (XmlSchemaProvider provider : providers) {
for (String namespace : namespaces) {
if (prefix.equals(provider.getDefaultPrefix(namespace, xmlFile))) {
return namespace;
}
}
}
return null;
}
示例8: getResourceLocation
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version) {
final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
if (schema != null) {
return schema;
}
final String location = getResourceLocation(url, version, baseFile.getProject());
return XmlUtil.findXmlFile(baseFile, location);
}
示例9: findNamespace
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static XmlFile findNamespace(@NotNull PsiFile base, @NotNull String nsLocation)
{
final String location = ExternalResourceManager.getInstance().getResourceLocation(nsLocation, base.getProject());
if(!location.equals(nsLocation))
{ // is mapped
return findXmlFile(base, location);
}
final XmlFile xmlFile = XmlSchemaProvider.findSchema(location, base);
return xmlFile == null ? findXmlFile(base, location) : xmlFile;
}
示例10: getResourceLocation
import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version)
{
final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
if(schema != null)
{
return schema;
}
final String location = getResourceLocation(url, version, baseFile.getProject());
return XmlUtil.findXmlFile(baseFile, location);
}