For 1.0.2 I created ugly workaround, but maybe it can help someone:
in my app I created package "play.data.binding" and class
"BigDecimalBinder implements SupportedType<BigDecimal>" with method:
public static void registerBinder() {
try {
Field stField = Binder.class.getDeclaredField("supportedTypes");
stField.setAccessible(true);
Map<Class<?>, SupportedType<?>> supportedTypes = (Map<Class<?>,
SupportedType<?>>) stField.get(null);
supportedTypes.put(BigDecimal.class, new BigDecimalBinder());
} catch (Exception e) {
throw new UnexpectedException(e);
}
}
then I call registerBinder from bootstrap job and have binder
registered.
On 16 Kwi, 13:02, Nicolas Leroux <
nico...@lunatech.com> wrote:
> Actually you can in the 1.1 but we will change it soon again so I would not recommend using the 1.1 at the moment.
>
> Nicolas
> On 16 apr 2010, at 11:43, Guillaume Bort wrote:
>
>
>
> > It's planned for the 1.1 to be able to specialize binding. But for now
> > you can't do it automatically. If you can't bind, just use the plain
> > old method.
>
> > On Fri, Apr 16, 2010 at 11:06 AM, Paweusz <
pawe...@gmail.com> wrote:
> >> Is there a way to implement custom binder in play? I need to bind
> >> BigDecimals in non standard format.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "play-framework" group.
> >> To post to this group, send email to
play-fr...@googlegroups.com.
> >> To unsubscribe from this group, send email to
play-framewor...@googlegroups.com.
> >> For more options, visit this group athttp://
groups.google.com/group/play-framework?hl=en.
> > For more options, visit this group athttp://
groups.google.com/group/play-framework?hl=en.
> For more options, visit this group athttp://
groups.google.com/group/play-framework?hl=en.