jp.hishidama.eval
クラス EvalExceptionFormatter

java.lang.Object
  上位を拡張 jp.hishidama.eval.EvalExceptionFormatter

public class EvalExceptionFormatter
extends Object

演算エラーメッセージ編集クラス.

EvalException用のエラーメッセージを編集する。

導入されたバージョン:
eval16
作成者:
ひしだま

コンストラクタの概要
EvalExceptionFormatter()
           
 
メソッドの概要
static EvalExceptionFormatter getDefault()
          デフォルトフォーマッター取得
 String getErrCodeMessage(int code)
          コード別メッセージ取得
 String getFormat(EvalException e, String msgFmt)
          フォーマット取得
 String toString(EvalException e)
          エラーメッセージ生成.
 String toString(EvalException e, String format)
          エラーメッセージ取得.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

EvalExceptionFormatter

public EvalExceptionFormatter()
メソッドの詳細

getDefault

public static EvalExceptionFormatter getDefault()
デフォルトフォーマッター取得

戻り値:
フォーマッター

toString

public String toString(EvalException e)
エラーメッセージ生成.

EvalExceptionのエラーメッセージを生成する。

パラメータ:
e - 例外
戻り値:
エラーメッセージ
関連項目:
EvalException.toString()

getErrCodeMessage

public String getErrCodeMessage(int code)
コード別メッセージ取得

パラメータ:
code - エラーコード
戻り値:
主メッセージ(フォーマット付き)

getFormat

public String getFormat(EvalException e,
                        String msgFmt)
フォーマット取得

パラメータ:
e - 例外
msgFmt - 主メッセージ
戻り値:
メッセージフォーマット

toString

public String toString(EvalException e,
                       String format)
エラーメッセージ取得.

フォーマットを元にメッセージを編集する。

%0〜9 付加情報の0〜9番。存在しない場合は空文字列
%c エラーコード
%n 解析名
%s 解析前の文字列
%p エラーが発生した、解析前文字列内の位置
%w エラーの原因となった文字列
%e 何らかの例外発生でエラーとなった場合の、その例外
%% 「%」

パラメータ:
e - 例外
format - フォーマット
戻り値:
エラーメッセージ