public class BooleanBinder
extends java.beans.PropertyEditorSupport
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
VALUE_0 |
static java.lang.String |
VALUE_1 |
static java.lang.String |
VALUE_FALSE |
static java.lang.String |
VALUE_NO |
static java.lang.String |
VALUE_OFF |
static java.lang.String |
VALUE_ON |
static java.lang.String |
VALUE_TRUE |
static java.lang.String |
VALUE_YES |
构造器和说明 |
---|
BooleanBinder(boolean allowEmpty)
Create a new CustomBooleanEditor instance, with "true"/"on"/"yes"
and "false"/"off"/"no" as recognized String values.
|
BooleanBinder(java.lang.String trueString,
java.lang.String falseString,
boolean allowEmpty)
Create a new CustomBooleanEditor instance,
with configurable String values for true and false.
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getAsText() |
void |
setAsText(java.lang.String text) |
public static final java.lang.String VALUE_TRUE
public static final java.lang.String VALUE_FALSE
public static final java.lang.String VALUE_ON
public static final java.lang.String VALUE_OFF
public static final java.lang.String VALUE_YES
public static final java.lang.String VALUE_NO
public static final java.lang.String VALUE_1
public static final java.lang.String VALUE_0
public BooleanBinder(boolean allowEmpty)
The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.
allowEmpty
- if empty strings should be allowedpublic BooleanBinder(java.lang.String trueString, java.lang.String falseString, boolean allowEmpty)
The "allowEmpty" parameter states if an empty String should be allowed for parsing, i.e. get interpreted as null value. Else, an IllegalArgumentException gets thrown in that case.
trueString
- the String value that represents true:
for example, "true" (VALUE_TRUE), "on" (VALUE_ON),
"yes" (VALUE_YES) or some custom valuefalseString
- the String value that represents false:
for example, "false" (VALUE_FALSE), "off" (VALUE_OFF),
"no" (VALUE_NO) or some custom valueallowEmpty
- if empty strings should be allowedVALUE_TRUE
,
VALUE_FALSE
,
VALUE_ON
,
VALUE_OFF
,
VALUE_YES
,
VALUE_NO
public void setAsText(java.lang.String text) throws java.lang.IllegalArgumentException
setAsText
在接口中 java.beans.PropertyEditor
setAsText
在类中 java.beans.PropertyEditorSupport
java.lang.IllegalArgumentException
public java.lang.String getAsText()
getAsText
在接口中 java.beans.PropertyEditor
getAsText
在类中 java.beans.PropertyEditorSupport