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


Java XsltChecker类代码示例

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


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

示例1: getDefaultNamespace

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
@Override
public String getDefaultNamespace(XmlElement context) {
  if (context != null) {
    if (XsltSupport.getXsltLanguageLevel(context.getContainingFile()) == XsltChecker.LanguageLevel.V2) {
      context = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);

      if (context != null) {
        do {
          final XmlTag tag = (XmlTag)context;
          String uri;
          if ((uri = tag.getAttributeValue("xpath-default-namespace", null)) != null ||
              (uri = tag.getAttributeValue("xpath-default-namespace", XsltSupport.XSLT_NS)) != null) {
            return !uri.isEmpty() ? uri : null;
          }
          context = PsiTreeUtil.getParentOfType(context, XmlTag.class, true);
        }
        while (context != null);
      }
    }
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:XsltNamespaceContext.java

示例2: ModeReference

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public ModeReference(XmlAttribute attribute, boolean isDeclaration) {
  super(attribute);
  if (isDeclaration) {
    myIsDeclaration = true;
  }
  else {
    final PsiFile file = attribute.getContainingFile();
    if (file != null && XsltSupport.getXsltLanguageLevel(file) == XsltChecker.LanguageLevel.V2) {
      final String value = attribute.getValue();
      myIsDeclaration = "#current".equals(value) || "#default".equals(value);
    }
    else {
      myIsDeclaration = false;
    }
  }
  myImplicitModeElement = new ImplicitModeElement(attribute);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ModeReference.java

示例3: getEditorsProvider

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project) {
  final XSourcePosition position = breakpoint.getSourcePosition();
  if (position == null) {
    return null;
  }

  final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
  if (file == null) {
    return null;
  }

  final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(file);
  if (level == XsltChecker.LanguageLevel.V1) {
    return myMyEditorsProvider1;
  } else if (level == XsltChecker.LanguageLevel.V2) {
    return myMyEditorsProvider2;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:XsltBreakpointType.java

示例4: getDefaultNamespace

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
@Override
public String getDefaultNamespace(XmlElement context) {
  if (context != null) {
    if (XsltSupport.getXsltLanguageLevel(context.getContainingFile()) == XsltChecker.LanguageLevel.V2) {
      context = PsiTreeUtil.getParentOfType(context, XmlTag.class, false);

      if (context != null) {
        do {
          final XmlTag tag = (XmlTag)context;
          String uri;
          if ((uri = tag.getAttributeValue("xpath-default-namespace", null)) != null ||
              (uri = tag.getAttributeValue("xpath-default-namespace", XsltSupport.XSLT_NS)) != null) {
            return uri.length() > 0 ? uri : null;
          }
          context = PsiTreeUtil.getParentOfType(context, XmlTag.class, true);
        }
        while (context != null);
      }
    }
  }

  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:XsltNamespaceContext.java

示例5: isXPathAttribute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public static boolean isXPathAttribute(@NotNull XmlAttribute attribute) {
  if (attribute.getValueElement() == null) return false;

  final String name = attribute.getName();
  if (isXsltAttribute(attribute)) {
    final String tagName = attribute.getParent().getLocalName();
    final String s = XPATH_ATTR_MAP.get(name);
    if ((s == null || s.length() > 0) && !tagName.equals(s)) {
      if (!isAttributeValueTemplate(attribute, true)) {
        return false;
      }
    }
  }
  else {
    if (!isAttributeValueTemplate(attribute, false)) {
      return false;
    }
  }

  final PsiFile file = attribute.getContainingFile();
  if (file != null) {
    XsltChecker.LanguageLevel level = getXsltLanguageLevel(file);
    if (level != XsltChecker.LanguageLevel.NONE) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:XsltSupport.java

示例6: isXsltFile

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public static boolean isXsltFile(@NotNull PsiFile psiFile) {
  if (psiFile.getFileType() != StdFileTypes.XML) return false;

  if (!(psiFile instanceof XmlFile)) return false;

  final XsltChecker.LanguageLevel level = getXsltLanguageLevel(psiFile);
  return level != XsltChecker.LanguageLevel.NONE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XsltSupport.java

示例7: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE, PsiModificationTracker.MODIFICATION_COUNT);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:XsltSupport.java

示例8: doTestXsltSupport

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
private void doTestXsltSupport() throws Throwable {
  configure();

  final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(myFixture.getFile());
  if (level != XsltChecker.LanguageLevel.NONE) {
    assertTrue(getName().contains("Supported"));
    assertTrue(XsltSupport.isXsltFile(myFixture.getFile()));
  } else {
    assertTrue(getName().contains("Unsupported"));
    assertFalse(XsltSupport.isXsltFile(myFixture.getFile()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XsltBasicTest.java

示例9: XsltDebugProcess

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public XsltDebugProcess(XDebugSession session, ExecutionResult executionResult, XsltChecker.LanguageLevel data) {
  super(session);
  myProcessHandler = executionResult.getProcessHandler();
  myProcessHandler.putUserData(KEY, this);
  myExecutionConsole = executionResult.getExecutionConsole();
  myEditorsProvider = new XsltDebuggerEditorsProvider(data);
  Disposer.register(myExecutionConsole, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XsltDebugProcess.java

示例10: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:XsltSupport.java

示例11: isXPathAttribute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public static boolean isXPathAttribute(@NotNull XmlAttribute attribute) {
    if (attribute.getValueElement() == null) return false;

    final String name = attribute.getName();
    if (isXsltAttribute(attribute)) {
        final String tagName = attribute.getParent().getLocalName();
        final String s = XPATH_ATTR_MAP.get(name);
        if ((s == null || s.length() > 0) && !tagName.equals(s)) {
            if (!isAttributeValueTemplate(attribute, true)) {
                return false;
            }
        }
    } else {
        if (!isAttributeValueTemplate(attribute, false)) {
            return false;
        }
    }

    final PsiFile file = attribute.getContainingFile();
    if (file != null) {
      XsltChecker.LanguageLevel level = getXsltLanguageLevel(file);
      if (level != XsltChecker.LanguageLevel.NONE) {
        return true;
      }
    }
  return false;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:28,代码来源:XsltSupport.java

示例12: isXsltFile

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public static boolean isXsltFile(@NotNull PsiFile psiFile) {
    if (psiFile.getFileType() != XmlFileType.INSTANCE) return false;

    if (!(psiFile instanceof XmlFile)) return false;

    final XsltChecker.LanguageLevel level = getXsltLanguageLevel(psiFile);
    return level != XsltChecker.LanguageLevel.NONE;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:9,代码来源:XsltSupport.java

示例13: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          } else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:32,代码来源:XsltSupport.java

示例14: ModeReference

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
public ModeReference(XmlAttribute attribute, boolean isDeclaration) {
    super(attribute);
    if (isDeclaration) {
        myIsDeclaration = true;
    } else {
        final PsiFile file = attribute.getContainingFile();
        if (file != null && XsltSupport.getXsltLanguageLevel(file) == XsltChecker.LanguageLevel.V2) {
          final String value = attribute.getValue();
          myIsDeclaration = "#current".equals(value) || "#default".equals(value);
        } else {
            myIsDeclaration = false;
        }
    }
    myImplicitModeElement = new ImplicitModeElement(attribute);
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:16,代码来源:ModeReference.java

示例15: getEditorsProvider

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
	final XSourcePosition position = breakpoint.getSourcePosition();
	if(position == null)
	{
		return null;
	}

	final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
	if(file == null)
	{
		return null;
	}

	final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(file);
	if(level == XsltChecker.LanguageLevel.V1)
	{
		return myMyEditorsProvider1;
	}
	else if(level == XsltChecker.LanguageLevel.V2)
	{
		return myMyEditorsProvider2;
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:28,代码来源:XsltBreakpointType.java


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