[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-92) give @Name annotation a default value

Gavin King (JIRA) jira-events at jboss.com
Tue Nov 21 04:22:46 EST 2006


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

Gavin King closed JBSEAM-92.
----------------------------


> give @Name annotation a default value
> -------------------------------------
>
>                 Key: JBSEAM-92
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-92
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Core
>    Affects Versions: 1.0 beta 1
>         Environment: normal
>            Reporter: ya xiang
>            Priority: Optional
>
> if I have many page to show ,and I have to manage little many seam component @Name.
> so  I want give @Name a default value, and default value is full class name variable named pattern. e.g. @Name public class MyComponent, named component is myComponenet, same as @Name("myComponent") public class MyComponent, just handle by exception.
> agree?
> code in Name.java:
> public @interface Name{
>   String value() default "";
> }
> and in Seam.java
>    public static String getComponentName(Class<?> clazz)
>    {
>       Name name = clazz.getAnnotation(Name.class);
>       //FIXME:modified by xiangya
>       if (name==null) return null;
>       String ret = name.value();
>       if ("".equals(ret)){
>     	  ret=clazz.getSimpleName();
>     	  ret=ret.substring(0,	1).toLowerCase()+ret.substring(1);
>       }
>       return ret;
>       // modified by xiangya
>    }

-- 
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