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

@ -168,7 +168,7 @@ public class ClientDynamicRegistrationEndpoint {
} }
}); });
} }
//TODO: this is a stub, make it work //TODO: this is a stub, make it work
@InitBinder({"require_auth_time"}) @InitBinder({"require_auth_time"})
@ -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();
}
}); });
} }