Working on init binder for ClientDynamicRegistrationEndpoint

pull/263/head
Amanda Anganes 2012-11-20 16:06:45 -05:00
parent 8b0c520534
commit 2084639828
1 changed files with 11 additions and 6 deletions

View File

@ -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();
}
});
}