|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.argius.stu.Command
コマンドの基底クラスです。
stu.command
パッケージに含まれるコマンドのサブクラスは、
入力されたコマンドに対応する名称のクラスが実行時にロードされ、実行されます。
(例:Testコマンド = stu.command.Test
クラス)
これは、実行時に参照可能なクラスであれば、自由に追加ができることを意味します。
クラス名は、先頭が大文字でその他が小文字になるようにします。
入力されたコマンドは、大文字小文字は無視されます。
コンストラクタの概要 | |
protected |
Command()
コマンドを生成します。 |
protected |
Command(Application app)
コマンドを生成します。 |
メソッドの概要 | |
protected void |
execute(Connection conn,
String parameter)
コマンドを実行します。 |
protected Command |
getCommand(String name)
コマンドオブジェクトを取得します。 |
protected int |
getLogLevel()
ログレベルを取得します。 |
protected String |
getMessage(String key)
メッセージを取得します。 |
protected String |
getMessage(String key,
Object args)
パラメータ埋め込み済みメッセージを取得します。 |
protected String |
getMessage(String key,
Object[] args)
パラメータ埋め込み済みメッセージを取得します。 |
protected String |
getProperty(String key)
プロパティを取得します。 |
protected int |
getTimeoutSeconds()
SQL実行待ち時間の設定を取得します。 |
protected void |
initialize(Application app)
コマンドを初期化します。 |
boolean |
invoke(Connection conn,
String parameter)
コマンドを起動します。 |
protected boolean |
isSelect(String query)
SQL文がSELECT文かどうか調べます。 |
protected void |
print(String message)
メッセージを出力します。 |
protected void |
print(String message,
int indent)
メッセージをインデント付きで出力します。 |
protected void |
println(String message)
メッセージを改行付きで出力します。 |
void |
propertyChange(PropertyChangeEvent evt)
プロパティが変更されたときの処理を実行します。 |
protected File |
resolvePath(String path)
指定したパスと作業ディレクトリを結合した File を生成します。
|
protected void |
setTimeout(Statement stmt)
SQL実行待ち時間を設定します。 |
protected int |
showResult(ResultSet rs)
結果を表示します。 |
protected StringQueue |
split(String parameter,
int count)
パラメータを分割します。 |
protected void |
warning(String message)
警告を表示します。 |
protected void |
writeLog(int level,
String message)
ログを出力します。 |
protected void |
writeLog(int level,
String message,
Throwable th)
ログを出力します。 |
protected void |
writeLog(int level,
Throwable th)
ログを出力します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
protected Command()
protected Command(Application app)
メソッドの詳細 |
protected void initialize(Application app)
public final boolean invoke(Connection conn, String parameter)
conn
- コネクションparameter
- 入力文字列
true
、異常終了した場合はfalse
protected void execute(Connection conn, String parameter) throws IllegalArgumentException, IOException, SQLException
conn
- コネクションparameter
- 入力文字列
IllegalArgumentException
- パラメータエラー
IOException
- 入出力エラー
SQLException
- SQLエラーprotected Command getCommand(String name)
name
- コマンド名
protected final String getMessage(String key)
key
- メッセージキー
protected final String getMessage(String key, Object args)
key
- メッセージキーargs
- 埋め込むパラメータ
protected final String getMessage(String key, Object[] args)
key
- メッセージキーargs
- 埋め込むパラメータの配列
protected final StringQueue split(String parameter, int count)
parameter
- パラメータcount
- 分割回数 ゼロ以下の場合は無制限
protected final int showResult(ResultSet rs)
rs
- 結果セット
protected final int getTimeoutSeconds()
protected final void setTimeout(Statement stmt)
0
以下の場合は何もしません。
設定エラーの場合もそのまま終了します。
stmt
- ステートメントprotected final boolean isSelect(String query)
query
- SQL文
true
、そうでなければfalse
protected final File resolvePath(String path)
File
を生成します。
指定パスが絶対パスの場合は絶対パスのまま返されます。
指定パスがnull
の場合の動作は保証されません。
path
- パス文字列
File
protected final void print(String message)
message
- メッセージprotected final void print(String message, int indent)
message
- メッセージindent
- インデント数protected final void println(String message)
message
- メッセージprotected final void warning(String message)
message
- メッセージpublic void propertyChange(PropertyChangeEvent evt)
PropertyChangeListener
内の propertyChange
evt
- プロパティ変更イベントprotected void writeLog(int level, String message)
level
- ログレベルmessage
- ログメッセージprotected void writeLog(int level, Throwable th)
level
- ログレベルth
- 例外またはエラーprotected void writeLog(int level, String message, Throwable th)
level
- ログレベルmessage
- ログメッセージth
- 例外またはエラーprotected String getProperty(String key)
key
- プロパティキー
protected int getLogLevel()
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |