Ok. It alleviates the problem in the next part, "Field initial value
declarations", with saying
"If an element representing a field specifies both an initial value and a type
declaration, a DefinitionException is thrown
by the Web Bean manager at initialization time."
Maybe it is good to put this sentences into the "Fields of a Web Bean" part.
Thanks;
Gurkan
________________________________
From: Gurkan Erdogdu <gurkanerdogdu(a)yahoo.com>
To: Nicklas Karlsson <nickarls(a)gmail.com>
Cc: webbeans-dev(a)lists.jboss.org
Sent: Thursday, December 4, 2008 5:49:23 PM
Subject: Re: [webbeans-dev] [XML Field Decleration]
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(a)gmail.com>
To: Gurkan Erdogdu <gurkanerdogdu(a)yahoo.com>
Cc: webbeans-dev(a)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