[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Property replacement

alesj do-not-reply at jboss.com
Wed Feb 7 05:34:46 EST 2007


I've added simple property replace to annotations def (the thing that was bothering Brian):


  |          String annString = annotation;
  |          // TODO - JBMICROCONT-143 + any better way?
  |          if (replace)
  |          {
  |             annString = StringPropertyReplacer.replaceProperties(annString);
  |          }
  |          //FIXME [JBMICROCONT-99] [JBAOP-278] Use the loader for the bean?
  |          ann = (Annotation)AnnotationCreator.createAnnotation(annString, Thread.currentThread().getContextClassLoader());
  | 

If there is any better idea ...

Btw, how does one get this:
I have this bean via XML:

  |    <bean name="MyBeanReplace" class="org.jboss.test.kernel.config.support.MyObject">
  |       <annotation>@org.jboss.test.kernel.config.support.SimpleAnnotation(name = "test.${test.property.value}.Name")</annotation>
  |    </bean>
  | 

And I would like to get its annotations in a classical way:

  | MyObject mybean = ...;
  | SimpleAnnotation ann = mybean.getClass().getAnnotation(SimpleAnnotation.class);
  | 

What AOP things must I add to XML, so that my bean gets annotation 'aspect'?

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

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



More information about the jboss-dev-forums mailing list