當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。