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