Working on init binder for ClientDynamicRegistrationEndpoint
parent
8b0c520534
commit
2084639828
|
@ -178,14 +178,19 @@ public class ClientDynamicRegistrationEndpoint {
|
|||
*/
|
||||
binder.registerCustomEditor(Boolean.class, new PropertyEditorSupport() {
|
||||
@Override
|
||||
public void setValue(Object obj) {
|
||||
if (obj != null) {
|
||||
setValue(obj);
|
||||
}
|
||||
else {
|
||||
public void setAsText(String text) throws IllegalArgumentException {
|
||||
if (Strings.isNullOrEmpty(text)) {
|
||||
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