本文整理匯總了Java中org.intellij.lang.xpath.validation.ExpectedTypeUtil.unparenthesize方法的典型用法代碼示例。如果您正苦於以下問題:Java ExpectedTypeUtil.unparenthesize方法的具體用法?Java ExpectedTypeUtil.unparenthesize怎麽用?Java ExpectedTypeUtil.unparenthesize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.intellij.lang.xpath.validation.ExpectedTypeUtil
的用法示例。
在下文中一共展示了ExpectedTypeUtil.unparenthesize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isPosition
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入方法依賴的package包/類
private static boolean isPosition(XPathExpression expression) {
expression = ExpectedTypeUtil.unparenthesize(expression);
if (!(expression instanceof XPathFunctionCall)) {
return false;
}
final XPathFunctionCall call = (XPathFunctionCall)expression;
final PrefixedName qName = call.getQName();
if (qName.getPrefix() != null) return false;
return "position".equals(qName.getLocalName());
}
示例2: checkExpressionOfType
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入方法依賴的package包/類
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));
}
}
示例3: isZero
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入方法依賴的package包/類
private static boolean isZero(XPathExpression op) {
op = ExpectedTypeUtil.unparenthesize(op);
// TODO: compute constant expression
return op != null && "0".equals(op.getText());
}
示例4: RemoveExplicitConversionFix
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入方法依賴的package包/類
public RemoveExplicitConversionFix(XPathExpression expression) {
super(ExpectedTypeUtil.unparenthesize(expression));
}