Package net.sf.jasperreports.engine.util
Class JRQueryParser
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRQueryParser
-
public class JRQueryParser extends Object
Report query parser.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_TOKEN_SEPARATORS_NOT_CONFIGURED
-
Constructor Summary
Constructors Constructor Description JRQueryParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
asClauseText(String[] tokens, Character separator)
(Re)constructs a query clause chunk from the chunk tokens.String
asText(JRQueryChunk[] chunks)
(Re)creates the query text from a list of chunks.protected char
defaultTokenSeparator()
protected char
determineClauseTokenSeparator(String clauseChunk)
protected String
getTokenSeparators()
static JRQueryParser
instance()
Returns a query parser instance.void
parse(String text, JRQueryChunkHandler chunkHandler)
Parses a report query.protected void
parseClause(JRQueryChunkHandler chunkHandler, String clauseChunk)
-
-
-
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
-
-
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 textchunkHandler
- a handler that will be asked to handle parsed query chunks
-
parseClause
protected void parseClause(JRQueryChunkHandler chunkHandler, String clauseChunk)
-
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 tokensseparator
- the chunk tokens separator character- Returns:
- the reconstructed query clause chunk
- See Also:
JRQueryChunk.TYPE_CLAUSE_TOKENS
-
defaultTokenSeparator
protected char defaultTokenSeparator()
-
-