クラス SqlTokenizer
- java.lang.Object
-
- com.github.mygreen.splate.parser.SqlTokenizer
-
public class SqlTokenizer extends Object
SQLをトークンに分解するクラスです。.- 作成者:
- higa
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static class
SqlTokenizer.TokenType
トークンの種類
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 SqlTokenizer(String sql)
-
メソッドの概要
すべてのメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 String
getAfter()
String
getBefore()
protected int
getNextStartPos(int commentStartPos, int elseCommentStartPos, int bindVariableStartPos)
Returns the next starting position.SqlTokenizer.TokenType
getNextTokenType()
int
getPosition()
String
getSql()
String
getToken()
SqlTokenizer.TokenType
getTokenType()
SqlTokenizer.TokenType
next()
protected String
nextBindVariableName()
protected void
parseBindVariable()
Parse the bind variable.protected void
parseComment()
Parse the comment.protected void
parseElse()
Parse the ELSE comment.protected void
parseEof()
Parse the end of the SQL.protected void
parseSql()
Parse the SQL.String
skipToken()
トークンをスキップします。String
skipWhitespace()
ホワイトスペースをスキップします。
-
-
-
コンストラクタの詳細
-
SqlTokenizer
public SqlTokenizer(String sql)
-
-
メソッドの詳細
-
getSql
public String getSql()
- 戻り値:
- SQLを返します。
-
getPosition
public int getPosition()
- 戻り値:
- 現在解析しているポジションを返します。
-
getToken
public String getToken()
- 戻り値:
- トークンを返します。
-
getBefore
public String getBefore()
- 戻り値:
- 現在解析しているポジションより前のSQLを返します。
-
getAfter
public String getAfter()
- 戻り値:
- 現在解析しているポジションより後ろのSQLを返します。
-
getTokenType
public SqlTokenizer.TokenType getTokenType()
- 戻り値:
- 現在のトークン種別を返します。
-
getNextTokenType
public SqlTokenizer.TokenType getNextTokenType()
- 戻り値:
- 次のトークン種別を返します。
-
next
public SqlTokenizer.TokenType next()
- 戻り値:
- 次のトークンに進みます。
-
parseSql
protected void parseSql()
Parse the SQL.
-
getNextStartPos
protected int getNextStartPos(int commentStartPos, int elseCommentStartPos, int bindVariableStartPos)
Returns the next starting position.- パラメータ:
commentStartPos
- starting position of the commentelseCommentStartPos
- starting position of the ELSE commentbindVariableStartPos
- starting position of the bind variable- 戻り値:
- the next starting position.
-
parseComment
protected void parseComment()
Parse the comment.
-
parseBindVariable
protected void parseBindVariable()
Parse the bind variable.
-
parseElse
protected void parseElse()
Parse the ELSE comment.
-
parseEof
protected void parseEof()
Parse the end of the SQL.
-
nextBindVariableName
protected String nextBindVariableName()
- 戻り値:
- the bind variable name for the position parameters.
-
skipToken
public String skipToken()
トークンをスキップします。- 戻り値:
- スキップしたトークン
-
skipWhitespace
public String skipWhitespace()
ホワイトスペースをスキップします。- 戻り値:
- スキップしたホワイストスペース
-
-