I'm fine with that. A little more verbosity won't kill me, as long as the functionality remains ;) Sounds good.<br><br><div class="gmail_quote">On Wed, Apr 14, 2010 at 2:11 PM, Dan Allen <span dir="ltr"><<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><div class="gmail_quote">On Wed, Apr 14, 2010 at 2:07 PM, Pete Muir <span dir="ltr"><<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
On 14 Apr 2010, at 18:59, Dan Allen wrote:<br>
<br>
> /**<br>
> * Inspect AnnoatedElement <b>element</b> for a specific <b>type</b> of annotation. This<br>
> * also discovers annotations defined through a @ {@link Stereotype} and the CDI SPI. Having found<br>
> * the annotation, it is inspected for a member with name <b>memberName</b>.<br>
> *<br>
> * @param element The element to inspect<br>
> * @param annotationType The annotation type to check for<br>
> * @param memberName The name of the member to look for<br>
> * @param expectedMemberType The expectedType of the member<br>
> * @param metaAnnotation Whether the annotation may be used as a meta-annotation or not<br>
> *<br>
> * @return The annotation member's value or null if no matching annotation was found<br>
> * @throws IllegalArgumentException if element, annotationType, memberName or expectedMemberType is null<br>
> * @throws IllegalArgumentException if the annotationType does not have a member of memberName<br>
> * @throws ClassCastException if the value of memberName cannot be cast to expectedMemberType<br>
> */<br>
> public static <V> V getAnnotationMemberValue(AnnotatedElement element, final Class<A> annotationType, String memberName, Class<V> expectedMemberType, boolean metaAnnotation)<br>
><br>
> WDYT?<br>
><br>
> I'm not sure I understand why we need a separate method to get an annotation member value. It requires specifying a string name. Why can't we simply return the annotation instance and then allow the value to be read by invoking the member method?<br>
<br>
</div>Actually, I agree with you here, but Lincoln complained mightily about this last night so I relented. Ok, let's strike this method.<br>
<div><br>
> I'll admit I was excited about the more fluent method names that Lincoln had in his code. Do we really need to have these long method names? Seems like pomp and circumstance to me. I suppose that this is what Java has always been about, so why take the garb off the queen? Boo.<br>
<br>
</div>I believe the consistency with the Java Reflection API is important (BTW Lincoln's API wasn't really fluent, just had shorter names).</blockquote></div><br></div></div>True, it was just shorter methods. Okay, without the long "getAnnotationMemberValue", the method names that are left are reasonable ;)<div>
<div></div><div class="h5"><div>
<br></div><div>-Dan<br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br><a href="http://www.google.com/profiles/dan.j.allen" target="_blank">http://www.google.com/profiles/dan.j.allen</a><br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>"Keep it Simple"<br>