Package org.apache.lucene.messages

Examples of org.apache.lucene.messages.MessageImpl


   * print the error message in the form:
   *     ParseException: <result of getMessage>
   */
  public ParseException(Token currentTokenVal,
     int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
     super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
     currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
     this.currentToken = currentTokenVal;
     this.expectedTokenSequences = expectedTokenSequencesVal;
     this.tokenImage = tokenImageVal;
   }
View Full Code Here


   * relevant information.  The JavaCC generated code does not use
   * these constructors.
   */

  public ParseException() {
     super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
   }
View Full Code Here

        }
      }
    }

    if (codePointMultiplier > 0) {
      throw new ParseException(new MessageImpl(
          QueryParserMessages.INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION));
    }

    if (lastCharWasEscapeChar) {
      throw new ParseException(new MessageImpl(
          QueryParserMessages.INVALID_SYNTAX_ESCAPE_CHARACTER));
    }

    return new UnescapedCharSequence(output, wasEscaped, 0, length);
  }
View Full Code Here

    } else if ('a' <= c && c <= 'f') {
      return c - 'a' + 10;
    } else if ('A' <= c && c <= 'F') {
      return c - 'A' + 10;
    } else {
      throw new ParseException(new MessageImpl(
          QueryParserMessages.INVALID_SYNTAX_ESCAPE_NONE_HEX_UNICODE, c));
    }
  }
View Full Code Here

      catch (ParseException tme) {
            tme.setQuery(query);
            throw tme;
      }
      catch (Error tme) {
          Message message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, tme.getMessage());
          QueryNodeParseException e = new QueryNodeParseException(tme);
            e.setQuery(query);
            e.setNonLocalizedMessage(message);
            throw e;
      }
View Full Code Here

          float fms = defaultMinSimilarity;
          try {
            fms = Float.valueOf(fuzzySlop.image.substring(1)).floatValue();
          } catch (Exception ignored) { }
         if(fms < 0.0f || fms > 1.0f){
           {if (true) throw new ParseException(new MessageImpl(QueryParserMessages.INVALID_SYNTAX_FUZZY_LIMITS));}
         }
         q = new FuzzyQueryNode(field, EscapeQuerySyntaxImpl.discardEscapeChar(term.image), fms, term.beginColumn, term.endColumn);
       }
      break;
    case RANGEIN_START:
View Full Code Here

  public MatchAllDocsQuery build(QueryNode queryNode) throws QueryNodeException {

    // validates node
    if (!(queryNode instanceof MatchAllDocsQueryNode)) {
      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{queryNode
              .toQueryString(new EscapeQuerySyntaxImpl()), queryNode.getClass()
              .getName()}));
    }
View Full Code Here

  public BooleanQuery build(QueryNode queryNode) throws QueryNodeException {

    // validates node
    if (!(queryNode instanceof MatchNoDocsQueryNode)) {
      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{queryNode
              .toQueryString(new EscapeQuerySyntaxImpl()), queryNode.getClass()
              .getName()}));
    }
View Full Code Here

  private void processNode(QueryNode node, QueryBuilder builder)
      throws QueryNodeException {

    if (builder == null) {

      throw new QueryNodeException(new MessageImpl(
          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{node
              .toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
              .getName()}));

    }
View Full Code Here

          try {
            bQuery.add(query, getModifierValue(child));

          } catch (TooManyClauses ex) {

            throw new QueryNodeException(new MessageImpl(
                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, new Object[]{BooleanQuery
                    .getMaxClauseCount(), queryNode
                    .toQueryString(new EscapeQuerySyntaxImpl())}), ex);

          }
View Full Code Here

TOP

Related Classes of org.apache.lucene.messages.MessageImpl

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.