|
From: Michael B. <mic...@gm...> - 2008-11-13 18:22:16
|
@DefaultValue(DefaultPojo.class) ?
Probably not that useful.
@DefaultValue(DefaultPojoFactory.class) ?
@DefaultValue(useProvider = true)
@DefaultValue()
and a new provider interface ?
public interface DefaultValueProvider<T> {
T get();
}
Michael Brackx
On Thu, Nov 13, 2008 at 7:09 PM, Bill Burke <bb...@re...> wrote:
>
>
> Michael Brackx wrote:
>>
>> On Thu, Nov 13, 2008 at 6:51 PM, Bill Burke <bb...@re...> wrote:
>>>
>>> I looked at the code and it seems that the @DefaultValue is run through
>>> the
>>> converter. Are you not seeing that behavior?
>>
>> Yes i do (actually, i added a test case for that)
>> What i meant is not specifying the default as string, but as an object.
>>
>> @DefaultValue(new Pojo("default"))
>>
>> otherwise you would need to convert the value yourself
>>
>> @DefaultValue(new PojoStingConverter().toString(new Pojo("default")))
>>
>
> Both are illegal. You can only use primitive constants within annotations
> as they are compiled directly into the bytecode.
>
> Bill
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
|