|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSqlParser
public final class SqlParser
The SqlParser class is a thread-safe class which parses a string containing a SQL statement with JdbcControl substitituion delimiters. It is important to note that the SQL is not parsed/validated - only the sections within the SQL string which are delimited by '{' and '}' are parsed.
Parsing is accomplished using the JavaCC grammar file SqlGrammer.jj. As the string is parsed it is broken into fragments by the parser. Any portion of the string which is not between '{' and '}' delimiters becomes a LiteralFragment. The portions of the SQL string which fall between the start and end delimiters are categorized as either JdbcFragment, ReflectionFragment, or SqlSubstitutionFragment. Fragments which subclass SqlFragmentContainer may contain other fragments as children. Fragements subclassed from SqlFragment my not contain child fragments. Upon completion of parsing a SqlStatement is returned to the caller. The SqlStatement contains the heirarchary of fragments which have been derived from the orignal SQL string. The parser will also cache all SqlStatements which contain non-volitale SQL. Only SqlEscapeFragments contain volitile SQL at this point.
Constructor Summary | |
---|---|
SqlParser()
Create a new instance of the SqlParser. |
Method Summary | |
---|---|
SqlStatement |
parse(String sql)
Parse the sql and return an SqlStatement. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlParser()
Method Detail |
---|
public SqlStatement parse(String sql)
sql
- A String contianing the sql to parse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |