当前位置: 首页>>代码示例>>Java>>正文


Java XPathTokenTypes.MULT属性代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:FunctionDeclarationParsing.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ExpectedTypeUtil.java


注:本文中的org.intellij.lang.xpath.XPathTokenTypes.MULT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。