org.seasar.extension.jdbc.gen.internal.sql
クラス SqlFileTokenizer

java.lang.Object
  上位を拡張 org.seasar.extension.jdbc.gen.internal.sql.SqlFileTokenizer

public class SqlFileTokenizer
extends java.lang.Object

SQLファイル内のトークンを認識するクラスです。

作成者:
taedium

入れ子のクラスの概要
static class SqlFileTokenizer.TokenType
          トークンのタイプを表します。
 
フィールドの概要
protected  boolean blockCommentStarted
          ブロックコメントが開始されている場合true
protected  java.lang.String blockDelimiter
          SQLブロックの区切り文字
protected  int length
          #lineの長さ
protected  java.lang.String line
          SQLの行
protected  int nextPos
          次の位置
protected  int pos
          現在の位置
protected  char statementDelimiter
          SQLステートメントの区切り文字
protected  java.lang.String token
          トークン
protected  SqlFileTokenizer.TokenType type
          トークンのタイプ
 
コンストラクタの概要
SqlFileTokenizer(char statementDelimiter, java.lang.String blockDelimiter)
          インスタンスを構築します。
 
メソッドの概要
 void addLine(java.lang.String line)
          一行の文字列を追加します。
 java.lang.String getToken()
          トークンを返します。
protected static boolean isOther(char c)
          コメントや単語以外の場合trueを返します。
 SqlFileTokenizer.TokenType nextToken()
          次のトークンタイプを返します。
protected  void peek(int index)
          次のトークンを前もって調べます。
protected  void peekChar(int index, char c)
          文字について次のトークンを前もって調べます。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

statementDelimiter

protected char statementDelimiter
SQLステートメントの区切り文字


blockDelimiter

protected java.lang.String blockDelimiter
SQLブロックの区切り文字


line

protected java.lang.String line
SQLの行


pos

protected int pos
現在の位置


nextPos

protected int nextPos
次の位置


length

protected int length
#lineの長さ


token

protected java.lang.String token
トークン


type

protected SqlFileTokenizer.TokenType type
トークンのタイプ


blockCommentStarted

protected boolean blockCommentStarted
ブロックコメントが開始されている場合true

コンストラクタの詳細

SqlFileTokenizer

public SqlFileTokenizer(char statementDelimiter,
                        java.lang.String blockDelimiter)
インスタンスを構築します。

パラメータ:
statementDelimiter - SQLステートメントの区切り文字
blockDelimiter - SQLブロックの区切り文字
メソッドの詳細

addLine

public void addLine(java.lang.String line)
一行の文字列を追加します。

パラメータ:
line - 一行の文字列

peek

protected void peek(int index)
次のトークンを前もって調べます。

パラメータ:
index - 開始インデックス

peekChar

protected void peekChar(int index,
                        char c)
文字について次のトークンを前もって調べます。

パラメータ:
index - 開始インデックス
c - 文字

nextToken

public SqlFileTokenizer.TokenType nextToken()
次のトークンタイプを返します。

戻り値:
次のトークンタイプ

isOther

protected static boolean isOther(char c)
コメントや単語以外の場合trueを返します。

パラメータ:
c - 文字
戻り値:
コメントや単語以外の場合true

getToken

public java.lang.String getToken()
トークンを返します。

戻り値:
トークン


Copyright © 2004-2014 The Seasar Foundation. All Rights Reserved.