Relax the AnnotationCreator string syntax to accept strings in single quotes
----------------------------------------------------------------------------
Key: JBMDR-50
URL:
https://jira.jboss.org/jira/browse/JBMDR-50
Project: JBoss MetaData Repository
Issue Type: Feature Request
Components: Annotations
Affects Versions: JBossMDR.2.0.0.GA
Reporter: Scott M Stark
A single line expression like the following
String annotationExpr =
"@org.jboss.managed.api.annotation.ManagementObject(name='testMetaDataRepositoryOverride',componentType=(a)org.jboss.managed.api.annotation.ManagementComponent(type='MCBean',
subtype='MetaDataTest'))";
ManagementObject override = (ManagementObject)
AnnotationCreator.createAnnotation(annotationExpr, ManagementObject.class);
fails with the following because single quoted strings are not accepted. As far as I know
there are no character expression in the grammar, so supporting single quoted strings
simplifies embedding the expression in code since you don't have to escape the double
quotes.
org.jboss.annotation.factory.ast.TokenMgrError: Lexical error at line 1, column 59.
Encountered: "e" (101), after : "\'t"
at
org.jboss.annotation.factory.ast.AnnotationParserTokenManager.getNextToken(AnnotationParserTokenManager.java:497)
at org.jboss.annotation.factory.ast.AnnotationParser.jj_ntk(AnnotationParser.java:632)
at
org.jboss.annotation.factory.ast.AnnotationParser.MemberValue(AnnotationParser.java:242)
at
org.jboss.annotation.factory.ast.AnnotationParser.MemberValuePair(AnnotationParser.java:218)
at
org.jboss.annotation.factory.ast.AnnotationParser.MemberValuePairs(AnnotationParser.java:175)
at
org.jboss.annotation.factory.ast.AnnotationParser.Annotation(AnnotationParser.java:93)
at org.jboss.annotation.factory.ast.AnnotationParser.Start(AnnotationParser.java:33)
at org.jboss.annotation.factory.AnnotationCreator$1.run(AnnotationCreator.java:354)
at org.jboss.annotation.factory.AnnotationCreator$1.run(AnnotationCreator.java:344)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.annotation.factory.AnnotationCreator.getRootExpr(AnnotationCreator.java:342)
at
org.jboss.annotation.factory.AnnotationCreator.getRootExpr(AnnotationCreator.java:330)
at
org.jboss.annotation.factory.AnnotationCreator.createAnnotation(AnnotationCreator.java:436)
at
org.jboss.test.managed.factory.test.AbstractManagedObjectFactoryUnitTestCase.testMetaDataRepositoryOverride(AbstractManagedObjectFactoryUnitTestCase.java:163)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira