OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-j message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [sca-j]JAVA-98: Proposed direction for resolution -- comments


Sorry that I could not find the original thread.

I would like to see we are consistence on inheritance rules as we stated in C&I to follow JSR 250. Copied the general guidelines from JSR 250. In case we see a need that certain annotation can not follow the rule, we should single them out. For others, we should just delegate to JSR 250.

In C&I 7.3.1
Inheritance And Annotation


In JSR 250 2.1General Guidelines for Inheritance of Annotations

In order to keep the resulting complexity in control, below are some guidelines recommended for how annotations defined in the different specifications should interact with inheritance:
1.Class-level annotations only affect the class they annotate and their members, that is, its methods and fields. They never affect a member declared by a superclass, even if it is not hidden or overridden by the class in question.
2. In addition to affecting the annotated class, class-level annotations may act as a shorthand for member-level annotations. If a member carries a specific member-level annotation, any annotations of the same type implied by a class-level annotation are ignored. In other words, explicit member-level annotations have priority over member-level annotations implied by a class-level annotation. For example, a @WebService annotation on a class implies that all the public method in the class that it is applied on are annotated with @WebMethod if there is no @WebMethod annotation on any of the methods. However if there is a @WebMethod annotation on any method then the @WebService does not imply the presence of @WebMethod on the other public methods in the class.
3. The interfaces implemented by a class never contribute annotations to the class itself or any of its members.
4. Members inherited from a superclass and which are not hidden or overridden maintain the annotations they had in the class that declared them, including member-level annotations implied by class-level ones.
5. Member-level annotations on a hidden or overridden member are always ignored.




Regards,

Yang Lei

WebSphere SCA Feature Pack Development -- SCA Architect
Phone: (919) 543 8887 T/L 441-8887
e-mail: yanglei@us.ibm.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]