[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Adding MetaData.isAnnotationPresent(String annotationTyp

adrian@jboss.org do-not-reply at jboss.com
Wed Feb 13 07:42:40 EST 2008


Of course, the above was pseudo code.

What I really mean is that you don't need to change the MetaData api,
you could just have a static helper method (real code):


  | public static boolean isAnnotationPresent(MetaData metaData, String name)
  | {
  |    if (metaData == null)
  |       throw new IllegalArgumentException("Null metadata");
  | 
  |    Object test = metaData.getMetaData(name);
  |    return test != null && (test instanceof Annotation);
  | }
  | 

But such a non-annotation using the name of annotation class would break
the assumption of how the annotation stuff works in the metadata. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129101#4129101

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129101



More information about the jboss-dev-forums mailing list