当前位置: 首页>>代码示例>>Java>>正文


Java XPathType.UNKNOWN属性代码示例

本文整理汇总了Java中org.intellij.lang.xpath.psi.XPathType.UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java XPathType.UNKNOWN属性的具体用法?Java XPathType.UNKNOWN怎么用?Java XPathType.UNKNOWN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.intellij.lang.xpath.psi.XPathType的用法示例。


在下文中一共展示了XPathType.UNKNOWN属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTypeForTag

protected XPathType getTypeForTag(XmlTag tag, String attribute) {
  String tagName = tag.getLocalName();
  if ("select".equals(attribute)) {
    if ("copy-of".equals(tagName) || "for-each".equals(tagName) || "apply-templates".equals(tagName)) {
      return XPathType.NODESET;
    } else if ("value-of".equals(tagName) || "sort".equals(tagName)) {
      return XPathType.STRING;
    }
    return XPathType.ANY;
  } else if ("test".equals(attribute)) {
    if ("if".equals(tagName) || "when".equals(tagName)) {
      return XPathType.BOOLEAN;
    }
  } else if ("number".equals(attribute)) {
    if ("value".equals(tagName)) {
      return XPathType.NUMBER;
    }
  }
  return XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XsltContextProviderBase.java

示例2: getType

@NotNull
public XPathType getType() {
    final XPathType declaredType = XsltCodeInsightUtil.getDeclaredType(getTag());
    if (declaredType != null) {
      return declaredType;
    }

    final XmlAttribute attr = getTag().getAttribute("type", XsltSupport.PLUGIN_EXTENSIONS_NS);
    if (attr != null) {
        return XPathType.fromString(attr.getValue());
    }
    final XPathExpression value = getValue();
    if (value instanceof XPathVariableReference) {
        // recursive reference <xsl:variable name="foo" select="$foo" />
        final XPathVariableReference reference = (XPathVariableReference)value;
        if (reference.resolve() == this) {
            return XPathType.UNKNOWN;
        }
    }
    return value != null ? value.getType() : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:XsltVariableImpl.java

示例3: checkExpression

protected void checkExpression(@NotNull XPathExpression expression) {
    final XPathType expectedType = ExpectedTypeUtil.getExpectedType(expression);
    // conversion to NODESET is impossible (at least not in a portable way) and is flagged by annotator
    if (expectedType != XPathType.NODESET && expectedType != XPathType.UNKNOWN) {
        final boolean isExplicit = FLAG_EXPLICIT_CONVERSION &&
                ExpectedTypeUtil.isExplicitConversion(expression);
        checkExpressionOfType(expression, expectedType, isExplicit);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ImplicitTypeConversion.java

示例4: getExpectedType

@NotNull
public XPathType getExpectedType(XPathExpression expr) {
  final XmlTag tag = PsiTreeUtil.getContextOfType(expr, XmlTag.class, true);
  if (tag != null && XsltSupport.isXsltTag(tag)) {
    final XsltElement element = XsltElementFactory.getInstance().wrapElement(tag, XsltElement.class);
    if (element instanceof XsltVariable) {
      return ((XsltVariable)element).getType();
    } else {
      final XmlAttribute attr = PsiTreeUtil.getContextOfType(expr, XmlAttribute.class, true);
      if (attr != null) {
        if (element instanceof XsltWithParam) {
          final XmlAttribute nameAttr = tag.getAttribute("name", null);
          if (nameAttr != null) {
            final XmlAttributeValue valueElement = nameAttr.getValueElement();
            if (valueElement != null) {
              final PsiReference[] references = valueElement.getReferences();
              for (PsiReference reference : references) {
                final PsiElement psiElement = reference.resolve();
                if (psiElement instanceof XsltVariable) {
                  return ((XsltVariable)psiElement).getType();
                }
              }
            }
          }
        } else {
          final String name = attr.getName();
          return getTypeForTag(tag, name);
        }
      }
    }
  }
  return XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:XsltContextProviderBase.java

示例5: getFunction

private Function getFunction() {
  final XPathType returnType = XsltCodeInsightUtil.getDeclaredType(getTag());
  final XmlTag[] params = getTag().findSubTags("param", XsltSupport.XSLT_NS);
  final Parameter[] parameters = ContainerUtil.map2Array(params, Parameter.class, PARAM_MAPPER);

  return new FunctionImpl(null, returnType != null ? returnType : XPathType.UNKNOWN, parameters) {
    @Override
    public String getName() {
      return getQName().getLocalPart();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XsltFunctionImpl.java

示例6: mapType

public static XPathType mapType(String type, XPath2SequenceType.Cardinality c) {
  if ("none".equals(type)) {
    return XPathType.UNKNOWN;
  }

  XPathType r = null;
  if ("numeric".equals(type)) {
    r = XPath2Type.NUMERIC;
  } else if (type.startsWith("xs:")) {
    final String base = type.substring(3);
    r = XPath2Type.fromName(new QName(XPath2Type.XMLSCHEMA_NS, base));
    if (r == null) {
      r = XPathType.fromString(base);
    }
  } else {
    if (type.endsWith("()")) {
      r = XPath2Type.fromName(new QName("", type));
    }
  }

  if (r != null) {
    if (c != null) {
      r = XPath2SequenceType.create(r, c);
    }
    return r;
  }
  return XPathType.fromString(type);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:FunctionDeclarationParsing.java

示例7: getType

@NotNull
@Override
public XPathType getType() {
  final XPath2TypeElement node = findChildByClass(XPath2TypeElement.class);
  return node != null ? node.getDeclaredType() : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:XPath2TreatAsImpl.java

示例8: getType

@NotNull
public XPathType getType() {
  final XPathExpression then = getThenBranch();
  final XPathExpression value = then != null ? then : getElseBranch();
  return value != null ? value.getType() : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:XPath2IfImpl.java

示例9: getType

@NotNull
public XPathType getType() {
  // +/-: isn't this always a number?
    final XPathExpression expression = getExpression();
    return expression != null ? expression.getType() : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:XPathPrefixExpressionImpl.java

示例10: getType

@NotNull
public XPathType getType() {
  final XPathType type = getTargetType();
  return type != null ? type : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XPath2CastImpl.java

示例11: getType

@NotNull
public XPathType getType() {
    final XPathExpression expression = getExpression();
    return expression != null ? expression.getType() : XPathType.UNKNOWN;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XPathParenthesizedExpressionImpl.java


注:本文中的org.intellij.lang.xpath.psi.XPathType.UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。