Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor$TokenType


    boolean inAnchorTag = false;
    boolean inHrefAttribute = false;
    int tokenEndColumn = 0;
    for (int i = 0, l = tokens.size() - 1; i < l; i++) {
      Token token = tokens.get(i);
      TokenType type = token.getType();
      String value = token.getValue();
      int tokenStartColumn = tokenEndColumn;
      tokenEndColumn += value.length()// Exclusive.
      if (type == TokenType.TAG) {
        if (">".equals(value) || "/>".equals(value)) {
View Full Code Here


      inAnchorTag = true;
    }
    int tokenEndColumn = 0;
    for (int i = 0, l = tokens.size() - 1; i < l; i++) {
      Token token = tokens.get(i);
      TokenType type = token.getType();
      String value = token.getValue();
      int tokenStartColumn = tokenEndColumn;
      tokenEndColumn += value.length();
      if (type == TokenType.TAG) {
        if (">".equals(value) || "/>".equals(value)) {
View Full Code Here

      MatchResult result = PARSER.exec(text);
      if (result == null) {
        throw new IllegalArgumentException("Can't parse: " + text);
      }
      String value;
      TokenType type;
      if (result.getGroup(2) != null) {
        value = result.getGroup(2);
        type = VARIABLE;
      } else if (result.getGroup(3) != null) {
        value = result.getGroup(3);
View Full Code Here

    int index = 0;

    while (index < size) {
      Token token = tokens.get(index);
      colCount += token.getValue().length();
      TokenType type = token.getType();
      index++;
      if (TokenType.TAG == type) {
        // Toggle "inTag" flag and update tag bounds.
        if (result.inTag) {
          // Refer to XmlCodeAnalyzer parsing code notes.
View Full Code Here

    StringMultiset tagAttributes = result.getAttributes();
    while (index < findTagResult.endTagIndex) {
      token = tokens.get(index);
      index++;
      TokenType tokenType = token.getType();
      if (TokenType.ATTRIBUTE == tokenType) {
        tagAttributes.add(token.getValue().toLowerCase());
      }
    }
View Full Code Here

        // Or new (temporary) object constructed.
        tag = buildTag(findTagResult, tokens);
      }
    }

    TokenType type = findTagResult.inToken.getType();
    String value = findTagResult.inToken.getValue();
    value = value.substring(0, value.length() - findTagResult.cut);
    if (TokenType.TAG == type) {
      value = value.substring(1).trim();
      return new HtmlAutocompleteProposals(
View Full Code Here

  @Override
  public void onParseLine(Line line, int lineNumber, JsonArray<Token> tokens) {
    int column = 0;
    for (Token token : tokens.asIterable()) {
      TokenType type = token.getType();
      String value = token.getValue();
      column = column + value.length();

      if (TokenType.WHITESPACE == type || TokenType.NEWLINE == type) {
        spaceBetween = true;
View Full Code Here

    idsToRelease.addAll(lineIds);
    lineIds.clear();

    for (int i = 0, l = tokens.size(); i < l; i++) {
      Token token = tokens.get(i);
      TokenType type = token.getType();
      if (type == VARIABLE || type == VARIABLE2 || type == PROPERTY || type == DEF) {
        String value = token.getValue();
        if (value.length() > 2) {
          lineIds.add(value);
        }
View Full Code Here

     * <p>Tokens that hold no information are omitted.
     *
     * @param nextToken token to push to context
     */
    private void nextToken(Token nextToken) {
      TokenType nextTokenType = nextToken.getType();
      if (WHITESPACE != nextTokenType && NEWLINE != nextTokenType) {
        predpred = pred;
        pred = nextToken;
      }
    }
View Full Code Here

    int index = 0;
    while (index < size) {
      Token token = tokens.get(index);
      index++;

      TokenType tokenType = token.getType();

      if (TokenType.WHITESPACE == tokenType
          || TokenType.NEWLINE == tokenType
          || TokenType.COMMENT == tokenType) {
        // TODO: Parse JsDocs.
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlCursor$TokenType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.