本文整理汇总了Java中org.intellij.lang.xpath.xslt.context.XsltNamespaceContext类的典型用法代码示例。如果您正苦于以下问题:Java XsltNamespaceContext类的具体用法?Java XsltNamespaceContext怎么用?Java XsltNamespaceContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XsltNamespaceContext类属于org.intellij.lang.xpath.xslt.context包,在下文中一共展示了XsltNamespaceContext类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrefixCompletions
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
static Object[] getPrefixCompletions(XmlAttribute attribute) {
final ModeReference.MyModeMatcher matcher = new ModeReference.MyModeMatcher(attribute, QNameUtil.ANY);
final PsiElement[] modes = ResolveUtil.collect(matcher);
final Collection<String> prefixes = XsltNamespaceContext.getPrefixes(attribute);
final Set<NamespaceLookup> lookups = new HashSet<NamespaceLookup>(prefixes.size());
for (PsiElement mode : modes) {
final QName qName = ((ImplicitModeElement)mode).getQName();
if (qName == null) continue;
final String prefix = qName.getPrefix();
if (!prefixes.contains(prefix)) continue;
lookups.add(new NamespaceLookup(prefix));
}
return ArrayUtil.toObjectArray(lookups);
}
示例2: getQName
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
@Nullable
public QName getQName() {
final String prefix = getPrefix();
if (prefix != null && prefix.length() > 0) {
final String uri = XsltNamespaceContext.getNamespaceUriStatic(prefix, myAttribute);
return uri != null && uri.length() > 0 ? new QName(uri, getName(), prefix) : QNameUtil.UNRESOLVED;
} else {
return new QName(getName());
}
}
示例3: createQName
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
public static QName createQName(@NotNull String qname, @NotNull PsiElement context) {
final String[] strings = qname.split(":", 2);
if (strings.length == 1) {
return new QName(null, qname);
}
final XmlElement ctx = PsiTreeUtil.getParentOfType(context, XmlElement.class, false);
if (ctx == null) return UNRESOLVED;
final String uri = XsltNamespaceContext.getNamespaceUriStatic(strings[0], ctx);
if (uri == null) return UNRESOLVED;
return new QName(uri, strings[1], strings[0]);
}
示例4: DefaultProvider
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
DefaultProvider(XmlElement contextElement) {
myContextElement = contextElement;
myContextType = ContextType.PLAIN;
if (myContextElement != null) {
myNamespaceContext = XsltNamespaceContext.NAMESPACE_CONTEXT;
setXPathInjected(myContextElement.getContainingFile());
} else {
myNamespaceContext = NULL_NAMESPACE_CONTEXT;
}
}
示例5: getVariants
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
@NotNull
@Override
public Object[] getVariants() {
return XsltNamespaceContext.getPrefixes(myAttribute).toArray();
}
示例6: resolveImpl
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
@Override
@Nullable
public PsiElement resolveImpl() {
return XsltNamespaceContext.resolvePrefix(getCanonicalText(), myAttribute);
}
示例7: getNamespaceContext
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
@Nullable
@Override
public NamespaceContext getNamespaceContext(@NotNull XmlElement xmlElement)
{
return XsltNamespaceContext.NAMESPACE_CONTEXT;
}
示例8: getVariants
import org.intellij.lang.xpath.xslt.context.XsltNamespaceContext; //导入依赖的package包/类
@NotNull
@Override
public Object[] getVariants()
{
return XsltNamespaceContext.getPrefixes(myAttribute).toArray();
}