[webbeans-dev] Questions & clarifications

pmuir at redhat.com pmuir at redhat.com
Wed Oct 29 13:08:10 EDT 2008


Just that invoking inner class constructors via reflection is a bit  
like black magic - is this definitely something we want to do...

--
Pete Muir
http://in.relation.to/Bloggers/Pete

On 29 Oct 2008, at 15:58, "Gavin King" <gavin at hibernate.org> wrote:

> On Tue, Oct 28, 2008 at 10:16 AM, Pete Muir <pmuir at redhat.com> wrote:
>
>>> 3.2.5.1 Declaring a Web Beans constructor
>>
>>
>>> If a simple Web Bean defined using annotations does not explicitly  
>>> declare
>>> a constructor using @Initializer, the constructor that accepts no  
>>> parameters
>>> is the Web Bean constructor.
>>
>>
>> It is possible to call constructors by reflection on inner classes,  
>> but it
>> requires you to rely on the (AFAIK unspecified) behaviour that the  
>> inner
>> class instance holds a reference to it's parent instance in the  
>> "this$<x>"
>> field, where
>>
>> x = (level-of-nesting - 1)
>>
>> WDYT?
>
> I don't understand what you're suggesting here, Pete.
>
>
> -- 
> Gavin King
> gavin.king at gmail.com
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org



More information about the weld-dev mailing list