本文整理匯總了Java中org.intellij.lang.xpath.validation.ExpectedTypeUtil類的典型用法代碼示例。如果您正苦於以下問題:Java ExpectedTypeUtil類的具體用法?Java ExpectedTypeUtil怎麽用?Java ExpectedTypeUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExpectedTypeUtil類屬於org.intellij.lang.xpath.validation包,在下文中一共展示了ExpectedTypeUtil類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: checkExpression
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入依賴的package包/類
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);
}
}
示例3: 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));
}
}
示例4: isSameType
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入依賴的package包/類
private boolean isSameType(XPathExpression expression, XPathType convertedType) {
XPathType type = ExpectedTypeUtil.mapType(expression, expression.getType());
while (type instanceof XPath2SequenceType) {
type = ((XPath2SequenceType)type).getType();
}
while (convertedType instanceof XPath2SequenceType) {
convertedType = ((XPath2SequenceType)convertedType).getType();
}
return ExpectedTypeUtil.mapType(expression, convertedType) == type;
}
示例5: 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());
}
示例6: RemoveExplicitConversionFix
import org.intellij.lang.xpath.validation.ExpectedTypeUtil; //導入依賴的package包/類
public RemoveExplicitConversionFix(XPathExpression expression) {
super(ExpectedTypeUtil.unparenthesize(expression));
}