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


Java XPathType.BOOLEAN屬性代碼示例

本文整理匯總了Java中org.intellij.lang.xpath.psi.XPathType.BOOLEAN屬性的典型用法代碼示例。如果您正苦於以下問題:Java XPathType.BOOLEAN屬性的具體用法?Java XPathType.BOOLEAN怎麽用?Java XPathType.BOOLEAN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.intellij.lang.xpath.psi.XPathType的用法示例。


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

示例1: isCheckedConversion

private boolean isCheckedConversion(XPathType exprType, XPathType type) {

            if (exprType == XPathType.NODESET) {
                if (type == XPathType.STRING && OPTIONS.get(0)) return true;
                if (type == XPathType.NUMBER && OPTIONS.get(4)) return true;
                if (type == XPathType.BOOLEAN && OPTIONS.get(8)) return true;
            } else if (exprType == XPathType.STRING) {
                if (type == XPathType.NUMBER && OPTIONS.get(5)) return true;
                if (type == XPathType.BOOLEAN && OPTIONS.get(9)) return true;
            } else if (exprType == XPathType.NUMBER) {
                if (type == XPathType.STRING && OPTIONS.get(2)) return true;
                if (type == XPathType.BOOLEAN && OPTIONS.get(10)) return true;
            } else if (exprType == XPathType.BOOLEAN) {
                if (type == XPathType.STRING && OPTIONS.get(3)) return true;
                if (type == XPathType.NUMBER && OPTIONS.get(11)) return true;
            }
            return false;
        }
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ImplicitTypeConversion.java

示例2: 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

示例3: checkExpressionOfType

private void checkExpressionOfType(@NotNull XPathExpression expression, XPathType type, boolean explicit) {
    final XPathType exprType = expression.getType();
    if (exprType.isAbstract() || type.isAbstract()) return;

    if (exprType != type && (explicit || isCheckedConversion(exprType, type))) {
        if (explicit && exprType == XPathType.STRING && type == XPathType.BOOLEAN) {
            final XPathExpression expr = ExpectedTypeUtil.unparenthesize(expression);
            if (expr instanceof XPathFunctionCall && IGNORE_NODESET_TO_BOOLEAN_VIA_STRING &&
                    ((XPathFunctionCall)expr).getArgumentList()[0].getType() == XPathType.NODESET)
            {
                return;
            }
        }

        final LocalQuickFix[] fixes;
        if (type != XPathType.NODESET) {
            final XPathQuickFixFactory fixFactory = ContextProvider.getContextProvider(expression).getQuickFixFactory();
            explicit = explicit && !(exprType == XPathType.STRING && type == XPathType.BOOLEAN);
            fixes = fixFactory.createImplicitTypeConversionFixes(expression, type, explicit);
        } else {
            fixes = null;
        }

        addProblem(myManager.createProblemDescriptor(expression,
                "Expression should be of type '" + type.getName() + "'", myOnTheFly, fixes,
                ProblemHighlightType.GENERIC_ERROR_OR_WARNING));
    }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:ImplicitTypeConversion.java

示例4: getExpectedType

@NotNull
@Override
public XPathType getExpectedType(XPathExpression expr) {
  return XPathType.BOOLEAN;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:XPathSupportProxyImpl.java

示例5: isAvailableImpl

public boolean isAvailableImpl(@NotNull Project project, Editor editor, PsiFile file) {
    return myExpression != null && myExpression.isValid() && myExpression.getType() == XPathType.BOOLEAN && myExpression.getROperand() != null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:FlipOperandsFix.java

示例6: JaxenEndsWith

public JaxenEndsWith() {
    super("ends-with", XPathType.BOOLEAN,
            new Parameter(XPathType.STRING, Parameter.Kind.REQUIRED),
            new Parameter(XPathType.STRING, Parameter.Kind.REQUIRED));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:XPathFunctionProviderImpl.java


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