gpt4 book ai didi

org.modeshape.common.xml.XmlCharacters.isValidNcName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 15:12:40 28 4
gpt4 key购买 nike

本文整理了Java中org.modeshape.common.xml.XmlCharacters.isValidNcName()方法的一些代码示例,展示了XmlCharacters.isValidNcName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlCharacters.isValidNcName()方法的具体详情如下:
包路径:org.modeshape.common.xml.XmlCharacters
类名称:XmlCharacters
方法名:isValidNcName

XmlCharacters.isValidNcName介绍

[英]Determine whether the supplied character is a valid non-first character in an XML NCName. The #isValidNcNameStart(int) in an XML NCName is more restrictive than the remaining characters.
[中]确定提供的字符是否为XML名称中的有效非第一个字符。XML NCName中的#isValidNcNameStart(int)比其余字符更具限制性。

代码示例

代码示例来源:origin: ModeShape/modeshape

@Override
  public boolean isNextValidXmlNcNameCharacter() {
    int nextIndex = lastIndex + 1;
    return nextIndex <= maxIndex && XmlCharacters.isValidNcName(content[nextIndex]);
  }
}

代码示例来源:origin: ModeShape/modeshape

/**
   * Determine if the supplied name is a valid XML NCName.
   * 
   * @param name the string being checked
   * @return true if the supplied name is indeed a valid XML NCName, or false otherwise
   */
  public static boolean isValidNcName( String name ) {
    if (name == null || name.length() == 0) return false;
    CharacterIterator iter = new StringCharacterIterator(name);
    char c = iter.first();
    if (!isValidNcNameStart(c)) return false;
    while (c != CharacterIterator.DONE) {
      if (!isValidNcName(c)) return false;
      c = iter.next();
    }
    return true;
  }
}

代码示例来源:origin: org.fcrepo/modeshape-common

/**
   * Determine if the supplied name is a valid XML NCName.
   * 
   * @param name the string being checked
   * @return true if the supplied name is indeed a valid XML NCName, or false otherwise
   */
  public static boolean isValidNcName( String name ) {
    if (name == null || name.length() == 0) return false;
    CharacterIterator iter = new StringCharacterIterator(name);
    char c = iter.first();
    if (!isValidNcNameStart(c)) return false;
    while (c != CharacterIterator.DONE) {
      if (!isValidNcName(c)) return false;
      c = iter.next();
    }
    return true;
  }
}

代码示例来源:origin: org.fcrepo/modeshape-common

@Override
  public boolean isNextValidXmlNcNameCharacter() {
    int nextIndex = lastIndex + 1;
    return nextIndex <= maxIndex && XmlCharacters.isValidNcName(content[nextIndex]);
  }
}

代码示例来源:origin: org.modeshape/modeshape-common

/**
   * Determine if the supplied name is a valid XML NCName.
   * 
   * @param name the string being checked
   * @return true if the supplied name is indeed a valid XML NCName, or false otherwise
   */
  public static boolean isValidNcName( String name ) {
    if (name == null || name.length() == 0) return false;
    CharacterIterator iter = new StringCharacterIterator(name);
    char c = iter.first();
    if (!isValidNcNameStart(c)) return false;
    while (c != CharacterIterator.DONE) {
      if (!isValidNcName(c)) return false;
      c = iter.next();
    }
    return true;
  }
}

代码示例来源:origin: org.modeshape/modeshape-common

@Override
  public boolean isNextValidXmlNcNameCharacter() {
    int nextIndex = lastIndex + 1;
    return nextIndex <= maxIndex && XmlCharacters.isValidNcName(content[nextIndex]);
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected String parseNCName( TokenStream tokens ) {
  String name = tokens.consume();
  if (!XmlCharacters.isValidNcName(name)) {
    throw new ParsingException(tokens.previousPosition(), "Expected valid NCName but found " + name);
  }
  return name;
}

代码示例来源:origin: ModeShape/modeshape

protected String parseNCName( TokenStream tokens ) {
  String name = tokens.consume();
  if (!XmlCharacters.isValidNcName(name)) {
    throw new ParsingException(tokens.previousPosition(), "Expected valid NCName but found " + name);
  }
  return name;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected BindVariableName parseBindVariableName( TokenStream tokens,
                         TypeSystem typeSystem ) {
  // The variable name must conform to a valid prefix, which is defined as a valid NCName ...
  String value = tokens.consume();
  if (!XmlCharacters.isValidNcName(value)) {
    Position pos = tokens.previousPosition();
    String msg = GraphI18n.bindVariableMustConformToNcName.text(value, pos.getLine(), pos.getColumn());
    throw new ParsingException(pos, msg);
  }
  return bindVariableName(value);
}

代码示例来源:origin: ModeShape/modeshape

protected BindVariableName parseBindVariableName( TokenStream tokens,
                         TypeSystem typeSystem ) {
  // The variable name must conform to a valid prefix, which is defined as a valid NCName ...
  String value = tokens.consume();
  if (!XmlCharacters.isValidNcName(value)) {
    Position pos = tokens.previousPosition();
    String msg = GraphI18n.bindVariableMustConformToNcName.text(value, pos.getLine(), pos.getColumn());
    throw new ParsingException(pos, msg);
  }
  return bindVariableName(value);
}

代码示例来源:origin: ModeShape/modeshape

if (!XmlCharacters.isValidNcName(prefix)) {
  throw new NamespaceException(JcrI18n.unableToRegisterNamespaceWithInvalidPrefix.text(prefix, uri));

代码示例来源:origin: org.fcrepo/modeshape-jcr

if (!XmlCharacters.isValidNcName(prefix)) {
  throw new NamespaceException(JcrI18n.unableToRegisterNamespaceWithInvalidPrefix.text(prefix, uri));

代码示例来源:origin: org.modeshape/modeshape-graph

protected StaticOperand parseStaticOperand( TokenStream tokens,
                      TypeSystem typeSystem ) {
  if (tokens.canConsume('$')) {
    // The variable name must conform to a valid prefix, which is defined as a valid NCName ...
    String value = tokens.consume();
    if (!XmlCharacters.isValidNcName(value)) {
      Position pos = tokens.previousPosition();
      String msg = GraphI18n.bindVariableMustConformToNcName.text(value, pos.getLine(), pos.getColumn());
      throw new ParsingException(pos, msg);
    }
    return bindVariableName(value);
  }
  if (tokens.canConsume('(')) {
    // Sometimes the subqueries are wrapped with parentheses ...
    StaticOperand result = parseStaticOperand(tokens, typeSystem);
    tokens.consume(')');
    return result;
  }
  if (tokens.matches("SELECT")) {
    // This is a subquery. This object is stateless, so we can reuse this object ...
    QueryCommand subqueryExpression = parseQueryCommand(tokens, typeSystem);
    return subquery(subqueryExpression);
  }
  return parseLiteral(tokens, typeSystem);
}

代码示例来源:origin: ModeShape/modeshape

pos = input.position(input.index());
int tokenType = XmlCharacters.isValidNcName(c) ? WORD : OTHER;
while (input.isNextValidXmlNcNameCharacter() && !input.isNextAnyOf(".-")) {
  c = input.next();

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com