jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] [703-FacesComponentValueAttributeOptional] CLOSED

From: Edward Burns <edward.burns_at_oracle.com>
Date: Mon, 5 Mar 2012 08:44:44 -0800

If I come across something very easy and valuable to do, I'll try to do
it right away. 703 is one such beast.

http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-703

Make "value" optional for @FacesComponent.

At this point, all you need to say to have a complete UIComponent with
tag and everything is

@FacesComponent(createTag=true)
public class MyComponent extends UIComponent*

I don't know why we didn't do this initially.

SECTION: Modified Files
----------------------------
M jsf-api/src/main/java/javax/faces/component/FacesComponent.java

- Spec language for now optional value attribute.

M jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/FacesComponentTagLibrary.java
M jsf-ri/src/main/java/com/sun/faces/application/annotation/ComponentConfigHandler.java
M jsf-test/JAVASERVERFACES_SPEC_PUBLIC-594/i_spec_594_war/src/main/java/com/sun/faces/test/i_spec_594_war/components/TagNameDerivedFromClassName.java


Index: jsf-api/src/main/java/javax/faces/component/FacesComponent.java
===================================================================
--- jsf-api/src/main/java/javax/faces/component/FacesComponent.java (revision 9740)
+++ jsf-api/src/main/java/javax/faces/component/FacesComponent.java (working copy)
@@ -89,14 +89,19 @@
     public static final String NAMESPACE = "http://java.sun.com/jsf/component";
 
     /**
- * <p class="changed_added_2_0">The value of this annotation
- * attribute is taken to be the <em>component-type</em> with which
- * instances of this class of component can be instantiated by
+ * <p class="changed_added_2_0"><span class="changed_modified_2_2">The</span>
+ * value of this annotation attribute is taken to be the
+ * <em>component-type</em> with which instances of this class of component can be instantiated by
      * calling {_at_link
- * javax.faces.application.Application#createComponent(java.lang.String)}</p>
+ * javax.faces.application.Application#createComponent(java.lang.String)}.
+ * <span class="changed_added_2_2">If no value is specified, or the value is
+ * <code>null</code>, the value is taken to be the return of calling
+ * <code>getSimpleName</code> on the class to which this annotation
+ * is attached and lowercasing the first character. If more than one
+ * component with this derived name is found, the results are undefined.</span></p>
      */
 
- String value();
+ String value() default "";
     

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/