Class JRQueryParser


  • public class JRQueryParser
    extends Object
    Report query parser.
    Author:
    Lucian Chirita (lucianc@users.sourceforge.net)
    • Field Detail

      • EXCEPTION_MESSAGE_KEY_TOKEN_SEPARATORS_NOT_CONFIGURED

        public static final String EXCEPTION_MESSAGE_KEY_TOKEN_SEPARATORS_NOT_CONFIGURED
        See Also:
        Constant Field Values
    • Constructor Detail

      • JRQueryParser

        public JRQueryParser()
    • Method Detail

      • instance

        public static JRQueryParser instance()
        Returns a query parser instance.
        Returns:
        a query parser instance
      • parse

        public void parse​(String text,
                          JRQueryChunkHandler chunkHandler)
        Parses a report query.
        Parameters:
        text - the query text
        chunkHandler - a handler that will be asked to handle parsed query chunks
      • determineClauseTokenSeparator

        protected char determineClauseTokenSeparator​(String clauseChunk)
      • getTokenSeparators

        protected String getTokenSeparators()
      • asText

        public String asText​(JRQueryChunk[] chunks)
        (Re)creates the query text from a list of chunks.
        Parameters:
        chunks - the chunks
        Returns:
        the recreated query text
      • asClauseText

        public String asClauseText​(String[] tokens,
                                   Character separator)
        (Re)constructs a query clause chunk from the chunk tokens.
        Parameters:
        tokens - the chunk tokens
        separator - the chunk tokens separator character
        Returns:
        the reconstructed query clause chunk
        See Also:
        JRQueryChunk.TYPE_CLAUSE_TOKENS
      • defaultTokenSeparator

        protected char defaultTokenSeparator()