Package org.eclipse.persistence.jpa.jpql

Examples of org.eclipse.persistence.jpa.jpql.WordParser


      if (hasLeftParenthesis || hasRightParenthesis)  {
        singleInputParameter = Boolean.FALSE;
      }
      else {
        WordParser wordParser = new WordParser(getInItems().toActualText());
        String word = wordParser.word();
        wordParser.moveForward(word);

        singleInputParameter = (word.length() > 0) &&
                               ExpressionTools.isParameter(word.charAt(0)) &&
                               wordParser.isTail();
      }
    }

    return singleInputParameter;
  }
View Full Code Here


    // Nothing to replace
    if (ExpressionTools.stringIsEmpty(proposal)) {
      return new Result(jpqlQuery, position);
    }

    WordParser wordParser = new WordParser(jpqlQuery);
    wordParser.setPosition(position);

    // Calculate the start and end positions
    int[] positions = buildPositions(wordParser, proposal, insert);

    // Create the new query
View Full Code Here

    // First convert the escape characters into their unicode characters
    String query = XmlEscapeCharacterConverter.unescape(jpqlQuery, positions);

    // Calculate the start and end positions
    WordParser wordParser = new WordParser(query);
    wordParser.setPosition(positions[0]);
    int[] proposalPositions = buildPositions(wordParser, proposal, insert);

    // Escape the proposal
    proposal = XmlEscapeCharacterConverter.escape(proposal, new int[1]);
View Full Code Here

      // Calculate the position of the cursor within the parsed tree
      queryPosition = jpqlExpression.buildPosition(jpqlQuery, position);

      // Retrieve the word from the JPQL query (which is the text before the position of the cursor)
      wordParser = new WordParser(jpqlQuery);
      wordParser.setPosition(position);
      word = wordParser.partialWord();

      // Now visit the deepest leaf first and calculate the possible proposals
      proposals = new DefaultContentAssistProposals(queryContext.getGrammar(), extension);
View Full Code Here

                        JPQLGrammar jpqlGrammar,
                        String queryBNFId,
                        boolean tolerant) {

    this(jpqlGrammar, queryBNFId, tolerant);
    parse(new WordParser(jpqlFragment), tolerant);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.WordParser

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.