當前位置: 首頁>>代碼示例>>Java>>正文


Java XsltParameter類代碼示例

本文整理匯總了Java中org.intellij.lang.xpath.xslt.psi.XsltParameter的典型用法代碼示例。如果您正苦於以下問題:Java XsltParameter類的具體用法?Java XsltParameter怎麽用?Java XsltParameter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XsltParameter類屬於org.intellij.lang.xpath.xslt.psi包,在下文中一共展示了XsltParameter類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isUnused

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
private static boolean isUnused(PsiElement obj, Query<PsiReference> query) {
    if (obj instanceof XsltParameter) {
        final Collection<PsiReference> references = query.findAll();
        int n = references.size();
        for (PsiReference reference : references) {
            final PsiElement element = reference.getElement();
            if (element instanceof XmlAttributeValue) {
                final XmlAttribute parent = (XmlAttribute)element.getParent();
                if ("name".equals(parent.getName())) {
                    final XmlTag tag = parent.getParent();
                    if (tag != null && "with-param".equals(tag.getLocalName())) {
                        n--;
                    }
                }
            }
        }
        return n == 0;
    } else {
        return query.findFirst() == null;
    }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:XsltValidator.java

示例2: buildSignature

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
public String buildSignature() {
    final StringBuilder sb = new StringBuilder(getName());
    final XsltParameter[] parameters = getParameters();
    if (parameters.length > 0) {
        sb.append(" (");
        for (int i1 = 0; i1 < parameters.length; i1++) {
            if (i1 > 0) {
                sb.append(", ");
            }
            if (parameters[i1].hasDefault()) {
                sb.append("[").append(parameters[i1].getName()).append("]");
            } else {
                sb.append(parameters[i1].getName());
            }
        }
        sb.append(")");
    }
    return sb.toString();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:XsltTemplateImpl.java

示例3: buildGroup

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
@Nullable
private static UsageGroup buildGroup(PsiElement referencedElement, UsageInfo u, boolean mustBeForeign) {
    if (referencedElement instanceof XsltParameter) {
        final XsltParameter parameter = (XsltParameter)referencedElement;
        final PsiElement element = u.getElement();
        if (element == null) return null;
        final XsltTemplate template = XsltCodeInsightUtil.getTemplate(element, false);
        if (template == null) return null;

        final boolean isForeign = XsltCodeInsightUtil.getTemplate(parameter, false) != template;
        if (template.getMatchExpression() != null && (isForeign || !mustBeForeign)) {
            return new TemplateUsageGroup(template);
        }
    }
    return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:XsltStuffProvider.java

示例4: isReferenceTo

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
public boolean isReferenceTo(PsiElement element, XPathVariableReference reference) {
    if (element instanceof XsltParameter) {
        final XsltTemplate template = XsltCodeInsightUtil.getTemplate(element, false);
        if (template == null || template.getMatchExpression() == null) return false;

        final XPathVariable t = reference.resolve();
        final PsiReference[] references = element.getReferences();
        for (PsiReference r : references) {
            if (r.isReferenceTo(t)) return true;
        }
    }
    return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:XsltVariableContext.java

示例5: getType

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
@NotNull
public String getType(@NotNull PsiElement element) {
    if (element instanceof XsltParameter) {
        return getParameterType((XsltParameter)element);
    }
    if (element instanceof XPathVariable) return "variable";
    if (element instanceof XsltTemplate) return "template";
    if (element instanceof XPathFunction) return "function";
    if (element instanceof ImplicitModeElement) return "mode";
    return "";
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:XsltLanguage.java

示例6: getParameterType

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
private static String getParameterType(XsltParameter myTarget) {
    final XmlTag parentTag = PsiTreeUtil.getParentOfType(myTarget.getNavigationElement(), XmlTag.class);
    if (parentTag != null) {
        if (XsltSupport.isXsltRootTag(parentTag)) {
            return "stylesheet parameter";
        } else if (XsltSupport.isTemplate(parentTag, false)) {
            return "template parameter";
        }
    }
    return "parameter";
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:XsltLanguage.java

示例7: getParameters

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
@NotNull
public XsltParameter[] getParameters() {
    final PsiElement[] elements = ResolveUtil.collect(new ParamMatcher(getTag(), null));

    final XsltParameter[] xsltParameters = new XsltParameter[elements.length];
    //noinspection SuspiciousSystemArraycopy
    System.arraycopy(elements, 0, xsltParameters, 0, elements.length);
    return xsltParameters;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:XsltTemplateImpl.java

示例8: deleteElement

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
protected void deleteElement(@NotNull XsltParameter obj) throws IncorrectOperationException {
    final XsltTemplate template = XsltCodeInsightUtil.getTemplate(obj.getTag(), false);
    if (template == null || template.getMatchExpression() == null) {
        final SearchScope searchScope = obj.getResolveScope();
      for (PsiReference reference : ReferencesSearch.search(obj, searchScope, false)) {
            final XmlTag t = PsiTreeUtil.getContextOfType(reference.getElement(), XmlTag.class, true);
            if (t != null && XsltSupport.XSLT_NS.equals(t.getNamespace())) {
                assert "with-param".equals(t.getLocalName());
                t.delete();
            }
        }
    }
    super.deleteElement(obj);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:DeleteUnusedParameterFix.java

示例9: getInstance

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
public static XsltParameter getInstance(@NotNull XmlTag target) {
    return XsltElementFactory.getInstance().wrapElement(target, XsltParameter.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:XsltParameterImpl.java

示例10: getParameter

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
@Nullable
public XsltParameter getParameter(String name) {
    return (XsltParameter)ResolveUtil.resolve(new ParamMatcher(getTag(), name));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:XsltTemplateImpl.java

示例11: canInline

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
private static boolean canInline(PsiElement element) {
  return element instanceof XsltVariable && !(element instanceof XsltParameter);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:VariableInlineHandler.java

示例12: AddWithParamFix

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
public AddWithParamFix(XsltParameter parameter, XmlTag tag) {
    myTag = tag;
    myName = parameter.getName();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:AddWithParamFix.java

示例13: DeleteUnusedParameterFix

import org.intellij.lang.xpath.xslt.psi.XsltParameter; //導入依賴的package包/類
public DeleteUnusedParameterFix(String name, XsltParameter param) {
    super(name, param);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:DeleteUnusedParameterFix.java


注:本文中的org.intellij.lang.xpath.xslt.psi.XsltParameter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。