[jboss-dev-forums] [Design the new POJO MicroContainer] - Reverting JBMDR-43

alesj do-not-reply at jboss.com
Mon Oct 6 08:57:04 EDT 2008


I'll revert Kabir's change:
 - https://jira.jboss.org/jira/browse/JBMDR-43

I think we should leave it to the caller
if it wants to replace ${x} in the annotation's values.

But I'll add four over-loaded methods that take Properties or replace flag
in AnnotationCreator.

  |    /**
  |     * Create annotation.
  |     *
  |     * @param annotationExpr the annotation expression
  |     * @param annotation the annotation class
  |     * @param replace should we replace possible properties in expression
  |     * @return new annotation instance
  |     * @throws Exception for any error 
  |     */
  |    public static Object createAnnotation(final String annotationExpr, final Class<?> annotation, boolean replace) throws Exception
  |    {
  |       return createAnnotation(getRootExpr(annotationExpr, null, replace), annotation, null);
  |    }
  | 
  |    /**
  |     * Create annotation.
  |     *
  |     * @param annotationExpr the annotation expression
  |     * @param cl the classloader to use
  |     * @param replace should we replace possible properties in expression
  |     * @return new annotation instance
  |     * @throws Exception for any error 
  |     */
  |    public static Object createAnnotation(String annotationExpr, ClassLoader cl, boolean replace) throws Exception
  |    {
  |       return createAnnotation(getRootExpr(annotationExpr, null, replace), null, cl);
  |    }
  | 
  |    /**
  |     * Create annotation.
  |     *
  |     * @param annotationExpr the annotation expression
  |     * @param annotation the annotation class
  |     * @param properties the properties to use for replacement
  |     * @return new annotation instance
  |     * @throws Exception for any error 
  |     */
  |    public static Object createAnnotation(final String annotationExpr, final Class<?> annotation, Properties properties) throws Exception
  |    {
  |       return createAnnotation(getRootExpr(annotationExpr, properties), annotation, null);
  |    }
  | 
  |    /**
  |     * Create annotation.
  |     *
  |     * @param annotationExpr the annotation expression
  |     * @param cl the classloader to use
  |     * @param properties the properties to use for replacement
  |     * @return new annotation instance
  |     * @throws Exception for any error 
  |     */
  |    public static Object createAnnotation(String annotationExpr, ClassLoader cl, Properties properties) throws Exception
  |    {
  |       return createAnnotation(getRootExpr(annotationExpr, properties), null, cl);
  |    }
  | 

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

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



More information about the jboss-dev-forums mailing list