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