public class CustomBooleanEditor extends PropertyEditorSupportSE
これはシステム PropertyEditor として使用するためのものではなく、カスタムコントローラーコード内のロケール固有のブールエディターとして使用して、UI によって引き起こされたブール文字列を Bean のブールプロパティに解析し、UI フォームでチェックします。
Web MVC コードでは、このエディターは通常 binder.registerCustomEditor
呼び出しで登録されます。
DataBinder.registerCustomEditor(java.lang.Class<?>, java.beans.PropertyEditor)
修飾子と型 | フィールドと説明 |
---|---|
static StringSE | VALUE_0 |
static StringSE | VALUE_1 |
static StringSE | VALUE_FALSE |
static StringSE | VALUE_NO |
static StringSE | VALUE_OFF |
static StringSE | VALUE_ON |
static StringSE | VALUE_TRUE |
static StringSE | VALUE_YES |
コンストラクターと説明 |
---|
CustomBooleanEditor(boolean allowEmpty) 認識された文字列値として "true" /"on" / "yes" および "false" /"off" / "no" を使用して、新しい CustomBooleanEditor インスタンスを作成します。 |
CustomBooleanEditor(StringSE trueString, StringSE falseString, boolean allowEmpty) true および false の設定可能な文字列値を使用して、新しい CustomBooleanEditor インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
StringSE | getAsText() |
void | setAsText(StringSE text) |
addPropertyChangeListenerSE, firePropertyChangeSE, getCustomEditorSE, getJavaInitializationStringSE, getSourceSE, getTagsSE, getValueSE, isPaintableSE, paintValueSE, removePropertyChangeListenerSE, setSourceSE, setValueSE, supportsCustomEditorSE
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public CustomBooleanEditor(boolean allowEmpty)
"allowEmpty" パラメーターは、空の文字列を解析に許可するかどうか、つまり null 値として解釈するかどうかを指定します。それ以外の場合は、その場合に IllegalArgumentException がスローされます。
allowEmpty
- 空の文字列を許可する場合 public CustomBooleanEditor(@Nullable StringSE trueString, @Nullable StringSE falseString, boolean allowEmpty)
"allowEmpty" パラメーターは、空の文字列を解析に許可するかどうか、つまり null 値として解釈するかどうかを指定します。それ以外の場合は、その場合に IllegalArgumentException がスローされます。
trueString
- true を表す文字列値: たとえば、"true" (VALUE_TRUE)、"on" (VALUE_ON)、"yes" (VALUE_YES)、いくつかのカスタム値 falseString
- false を表す文字列値: たとえば、"false" (VALUE_FALSE)、"off" (VALUE_OFF)、"no" (VALUE_NO)、カスタム値 allowEmpty
- 空の文字列を許可する場合 VALUE_TRUE
, VALUE_FALSE
, VALUE_ON
, VALUE_OFF
, VALUE_YES
, VALUE_NO
public void setAsText(@Nullable StringSE text) throws IllegalArgumentExceptionSE
PropertyEditorSE
の setAsTextSE
PropertyEditorSupportSE
の setAsTextSE
IllegalArgumentExceptionSE
public StringSE getAsText()
PropertyEditorSE
の getAsTextSE
PropertyEditorSupportSE
の getAsTextSE