Hi Nick,

Thanks for answer.

But then it is able to define a field in the XML that the field initial value is an integer but the field is actually an injection point for the another webbeans, I think it must be error for such an configuration.

For example;

public class MyBean
{
   @Current x.y.x.AnotherBean injectedBean; --> then how to possible to set 15 as an initial value?
}


From: Nicklas Karlsson <nickarls@gmail.com>
To: Gurkan Erdogdu <gurkanerdogdu@yahoo.com>
Cc: webbeans-dev@lists.jboss.org
Sent: Thursday, December 4, 2008 5:38:48 PM
Subject: Re: [webbeans-dev] [XML Field Decleration]

You can get a quick interpretation for me and then wait for a correct one ;-)

> In the spec within the part of the "Fields of a Web Bean", it says that
>
> "If a field declaration has more than one direct child element, and at least
> one of these elements is not <value> element in
> the Web Beans namespace, a DefinitionException is thrown by the Web Bean
> manager at initialization time."
>
> Then, is it true that the following definition is correct ? iow, can the
> field decleration contains both the <value> field and the injection field?
>
> <mybean:myField>
>    <value>15</value>
>    <mybean>x.y.x.AnotherBean</mybean>
> </mybean:myField>

I don't see a problem. The problem would be if the <value> wouldn't be
there. The sentence alone would not
forbid multiple <value> fields, either.

> Actually it also says that "An element that represents a field may declare
> an injected field, a producer field or a field with an initial value.".
>
> is there a contradiction?

Well, I dont see any "one of" so I don't see the contradiction.

This is only my interpretation of the word in the specs, I don't have
any more details.


--
---
Nik