[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1117) support enum types in @RaiseEvent or a new @RaiseEventType annotation

Gavin King (JIRA) jira-events at lists.jboss.org
Mon May 21 13:48:52 EDT 2007

     [ http://jira.jboss.com/jira/browse/JBSEAM-1117?page=all ]

Gavin King closed JBSEAM-1117.

    Fix Version/s: 1.3.0.BETA1
       Resolution: Partially Completed
         Assignee: Gavin King

Multiple event types are now supported.

> support enum types in @RaiseEvent or a new @RaiseEventType annotation
> ---------------------------------------------------------------------
>                 Key: JBSEAM-1117
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1117
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Core
>            Reporter: Bradley Smith
>         Assigned To: Gavin King
>             Fix For: 1.3.0.BETA1
> RaiseEvent:
> @Target(METHOD)
> @Retention(RUNTIME)
> @Documented
> public @interface RaiseEvent 
> {
>    /**
>     * The event name, defaults to the name
>     * of the method.
>     * 
>     * @return the event name
>     */
>    String value() default "";
>    //TODO: String[] ifOutcome() default {};
> }
> Is it possible to make the value be based on an enum type?  I currently have all my application event types enumerated in enum called EventType.
> I've tried doing:  
> @RaiseEvent(EventType.ApplicationSaved.name())
> however, this doesn't count as a constant String and is invalid syntax.  It seems more 'elegant' to be able to enumerate the event types of an application in something like an enum than to sprinkle strings throughout the code with the specific event String values.
> Maybe an alternate annotation is called for - say, @RaiseEventType(MyEnum.MyEventType)?
> I'm not sure - I don't have a solid grasp of the syntax used to define an annotation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list