[ https://issues.apache.org/jira/browse/FLEX-33332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13541085#comment-13541085 ]
Roland Zwaga commented on FLEX-33332: ------------------------------------- As an addendum, I think this would be probably the simplest way of defining a list of value constraints for an annotation argument: public var options:Vector.<String> = new <String>("option1", "option2"); Obviously, if an argument is a class, the compiler can check if the qualified name exists: public var clazz:Class; It would be even nicer if somehow the Class value could be constrained as well, for instance, the arguments needs to be of type Class, but the Class needs to be a subclass of Event. I don't have an immediate idea for a clean solution to that, so if anyone has ideas, please chime in. > Make metadata annotations first class AS3 citizens > -------------------------------------------------- > > Key: FLEX-33332 > URL: https://issues.apache.org/jira/browse/FLEX-33332 > Project: Apache Flex > Issue Type: Improvement > Components: Compiler API > Affects Versions: Apache Flex 4.9.0 > Reporter: Roland Zwaga > Assignee: Michael Schmalle > Priority: Minor > > Currently metadata annotations are only checked by certain IDE's using some > sort of extra metadata. > Making metadata first class AS3 citizens would allow the compiler to check > and verify annotations. > So, for each metadata tag there would need to exist a corresponding AS3 class > that describes this tag, > In practice, an annotation like this: > [Bindable(event="dataChanged")] > public var data:String; > There would need to exist a class like this: > [MetadataAnnotation] > public class Bindable { > [Optional] > public var event:String; > } > Or something like that... > The MetadataAnnotation metadata would be the entry point for the compiler. > The actual class would not necessarily need to be compiled in the eventual > target. (Or maybe it should, perhaps for JS cross-compilation this could > actually enable annotation support...) > Thoughts? Suggestions? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira