|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectcom.nexaweb.plugin.validation.validators.Validator
jp.co.fujitsu.reffi.client.nexaweb.validator.CustomValidator
jp.co.fujitsu.reffi.client.nexaweb.validator.ByteLengthValidator
public class ByteLengthValidator
[概 要]
バイト長範囲バリデータクラスです。[詳 細]
[備 考]
使用例) BaseAction継承クラス#validatorsメソッドで以下のように使用します。
@Override
protected void validators(List validators) {
// バリデーション対象エレメントを引数にしてインスタンス生成
ByteLengthValidator validator =
new ByteLengthValidator(getElementByName("target"));
// 独自のエラーメッセージを使う場合
validator.setErrorMessage("29bytesまでの制限があります。");
// バイト長範囲(0bytes~29bytes)を設定
validator.setBytesRange(0,29);
// 引数validatorsに追加
validators.add(validator);
}
Copyright (c) 2008-2010 FUJITSU Japan All rights reserved.
| コンストラクタの概要 | |
|---|---|
ByteLengthValidator(Element element)
[概 要] コンストラクタです。 |
|
| メソッドの概要 | |
|---|---|
String |
registerErrorMessage()
[概 要] エラー文言登録メソッドです。 |
void |
setBytesRange(int min,
int max)
[概 要] 許容範囲のバイト長を設定します。 |
protected boolean |
validate(Object value)
[概 要] バイト長バリデーションを行います。 |
| クラス jp.co.fujitsu.reffi.client.nexaweb.validator.CustomValidator から継承されたメソッド |
|---|
getErrorMessage, getHeadWord, getValue, setErrorMessage, setHeadWord |
| クラス com.nexaweb.plugin.validation.validators.Validator から継承されたメソッド |
|---|
addValidationListener, execute, getElement, getSession, initialize, isWhitespaceTrimmed, onFailure, onSuccess, removeValidationListener, setElement, setIsWhitespaceTrimmed, setSession |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public ByteLengthValidator(Element element)
[概 要]
コンストラクタです。[詳 細]
引数element付きでsuper()を呼び出します。[備 考]
element - | メソッドの詳細 |
|---|
public void setBytesRange(int min,
int max)
[概 要]
許容範囲のバイト長を設定します。[詳 細]
minフィールドに引数minを、maxフィールドに引数maxを設定します。[備 考]
min - 最小文字長数max - 最大文字長数public String registerErrorMessage()
[概 要]
エラー文言登録メソッドです。[詳 細]
jp.co.fujitsu.reffi.shared.exception.corelogic_message.properties から対応するエラーメッセージを取得して返却します。[備 考]
CustomValidator 内の registerErrorMessage
protected boolean validate(Object value)
throws com.nexaweb.plugin.validation.exceptions.ValidationException
[概 要]
バイト長バリデーションを行います。[詳 細]
[備 考]
com.nexaweb.plugin.validation.validators.Validator 内の validatevalue - エレメント値
com.nexaweb.plugin.validation.exceptions.ValidationException
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||