本文整理汇总了Java中org.intellij.lang.xpath.XPathTokenTypes.MULT属性的典型用法代码示例。如果您正苦于以下问题:Java XPathTokenTypes.MULT属性的具体用法?Java XPathTokenTypes.MULT怎么用?Java XPathTokenTypes.MULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.intellij.lang.xpath.XPathTokenTypes
的用法示例。
在下文中一共展示了XPathTokenTypes.MULT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseCardinality
@Nullable
public static XPath2SequenceType.Cardinality parseCardinality(Lexer lexer) {
if (lexer.getTokenType() == XPath2TokenTypes.QUEST) {
lexer.advance();
return XPath2SequenceType.Cardinality.OPTIONAL;
} else if (lexer.getTokenType() == XPathTokenTypes.MULT || lexer.getTokenType() == XPathTokenTypes.STAR) {
lexer.advance();
return XPath2SequenceType.Cardinality.ZERO_OR_MORE;
} else if (lexer.getTokenType() == XPathTokenTypes.PLUS) {
lexer.advance();
return XPath2SequenceType.Cardinality.ONE_OR_MORE;
}
return null;
}
示例2: matchingType
private static XPathType matchingType(XPathExpression lOperand, XPathElementType op) {
final XPathType type = mapType(lOperand, lOperand.getType());
if (op == XPathTokenTypes.PLUS) {
if (XPathType.isAssignable(XPath2Type.NUMERIC, type)) {
return XPath2Type.NUMERIC;
} else if (XPathType.isAssignable(XPath2Type.DATE, type) ||
XPathType.isAssignable(XPath2Type.TIME, type) ||
XPathType.isAssignable(XPath2Type.DATETIME, type)) {
return XPath2Type.DURATION;
} else if (XPathType.isAssignable(XPath2Type.DURATION, type)) {
return XPathType.ChoiceType.create(XPath2Type.DURATION, XPath2Type.DATE, XPath2Type.TIME, XPath2Type.DATETIME);
}
} else if (op == XPathTokenTypes.MINUS) {
if (XPathType.isAssignable(XPath2Type.NUMERIC, type)) {
return XPath2Type.NUMERIC;
} else if (XPathType.isAssignable(XPath2Type.DATE, type) ||
XPathType.isAssignable(XPath2Type.TIME, type) ||
XPathType.isAssignable(XPath2Type.DATETIME, type)) {
return XPathType.ChoiceType.create(type, XPath2Type.DURATION);
} else if (XPathType.isAssignable(XPath2Type.DURATION, type)) {
return XPath2Type.DURATION;
}
} else if (op == XPathTokenTypes.MULT) {
if (XPathType.isAssignable(XPath2Type.NUMERIC, type)) {
return XPathType.ChoiceType.create(XPath2Type.NUMERIC, XPath2Type.DURATION);
} else if (XPath2Type.DURATION.isAssignableFrom(type)) {
return XPath2Type.NUMERIC;
}
} else if (op == XPath2TokenTypes.IDIV || op == XPathTokenTypes.MOD) {
return XPath2Type.NUMERIC;
} else if (op == XPathTokenTypes.DIV) {
if (XPathType.isAssignable(XPath2Type.NUMERIC, type)) {
return XPath2Type.NUMERIC;
} else if (XPath2Type.DURATION.isAssignableFrom(type)) {
return XPath2Type.ChoiceType.create(XPath2Type.NUMERIC, XPath2Type.DURATION);
}
}
// TODO
return XPathType.UNKNOWN;
}