当前位置: 首页>>代码示例>>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;未经允许,请勿转载。