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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...