Working on init binder for ClientDynamicRegistrationEndpoint
parent
8b0c520534
commit
2084639828
|
@ -178,14 +178,19 @@ public class ClientDynamicRegistrationEndpoint {
|
||||||
*/
|
*/
|
||||||
binder.registerCustomEditor(Boolean.class, new PropertyEditorSupport() {
|
binder.registerCustomEditor(Boolean.class, new PropertyEditorSupport() {
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Object obj) {
|
public void setAsText(String text) throws IllegalArgumentException {
|
||||||
if (obj != null) {
|
if (Strings.isNullOrEmpty(text)) {
|
||||||
setValue(obj);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
setValue(false);
|
setValue(false);
|
||||||
|
} else {
|
||||||
|
setValue(new Boolean(text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getAsText() {
|
||||||
|
Boolean bool = (Boolean) getValue();
|
||||||
|
return bool == null? "false" : bool.toString();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue