-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDI-420 define trim also in beans xsd. #348
Conversation
@@ -353,5 +354,14 @@ | |||
</xs:choice> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element name="trim" type="xs:string" fixed=""> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking if we could/should add some restrictive attributes here. Such as limiting min/max occurrences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to force occurrence to 1. Otherwise looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I was thinking about this as well. So then it makes sense to change it as above. I don't think it makes sense to allow multiple occurences of e.g <scan>
.
I don't know xsd much, but now each of these elements could be specified only once or do somebody have better idea how to define this???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My science in xsd is not very high, but my friend Google told me that:
The all element specifies that the child elements can appear in any order and that each child element can occur zero or one time.
(See ref here)
So minOccurs
attributes are useless here IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are talking about lines 81-85 then your suggestion doesn't seem to be correct in this case because the minOccurs
default value is 1 here AFAIK.
I was experimenting in Idea and if you omit minOccurs
then you really will need to define all the elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right @tremes. Pr is good for me then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
My concern is that with this approach we could potentially break beans.xml files e.g with multiple |
@tremes it looks like a corner case and can't happen without user modification. |
@antoinesd ok you are probably right. Thanks |
+1 from me |
I cannot see my comments were taken into consideration: Bean defining annotations include the any scope annotations. Therefore, it makes more sense to delete "or any scope annoation". |
@Emily-Jiang Bean defining annotations only contain normal scopes and |
@mkouba It is confusing to add the support for @singleton and other pseudo-scopes as they are not beans. What user case do you have in mind? |
Actually, |
Then we should push to get @singleton added to CDI-2.0 spec as bean defining annotations. -1 on adding other pseudo-scopes though. |
Problem is that @singleton annotation is not from CDI API but from javax inject API. Pseudo scopes are necessary IMO. |
@Emily-Jiang take a look at https://issues.jboss.org/browse/CDI-377 resolved in CDI 1.2 |
@antoinesd thanks. I am not comfortable that we support these annotations as beans without being stated in the spec. This is another discussion. |
Attempt to define
trim
in beans_2_0.xsd. This should be just an empty element if I am not wrong.