クラス SqlTokenizer


  • public class SqlTokenizer
    extends Object
    SQLをトークンに分解するクラスです。.
    作成者:
    higa
    • コンストラクタの詳細

      • 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()
        戻り値:
        次のトークン種別を返します。
      • 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 comment
        elseCommentStartPos - starting position of the ELSE comment
        bindVariableStartPos - 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()
        ホワイトスペースをスキップします。
        戻り値:
        スキップしたホワイストスペース