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

[jsr344-experts] UIComponent API review

From: Andy Schwartz <andy.schwartz_at_oracle.com>
Date: Wed, 13 Mar 2013 13:42:22 -0400

Review comments for UIComponent...

Index: javax/faces/component/UIComponent.java
===================================================================
--- javax/faces/component/UIComponent.java (revision 8845)
+++ javax/faces/component/UIComponent.java (revision 11719)

> /**
> - * <p class="changed_added_2_0">The key to which the
> + * <p class="changed_added_2_0"><span
> + * class="changed_deleted_2_2">The</span> key to which the
> * <code>UIComponent</code> currently being processed will be
> - * associated with within the {_at_link FacesContext} attributes
> map.</p>
> + * associated with within the {_at_link FacesContext} attributes
> + * map. <span class="changed_deleted_2_2">The use of this constant is
> + * deprecated. Please see {_at_link
> + * #HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME} to enable its
> + * use.</span></p>
> *
> * @see javax.faces.context.FacesContext#getAttributes()
> *
> * @since 2.0
> + *
> + * @deprecated
> */
> public static final String CURRENT_COMPONENT =
> "javax.faces.component.CURRENT_COMPONENT";


We should deprecate the HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME
constant. Would be great if we could remove this functionality in 2.3.

+ /**
+ * <p class="changed_added_2_2">This method has the same
specification as
+ * {_at_link #getPassThroughAttributes() } except that it is allowed
to return
+ * {_at_code null} if and only if the argument {_at_code create} is
{_at_code false}
+ * and no pass through attribute data structure exists for this
instance.
+ * The returned {_at_code Map} implementation must support all of the
standard and optional
+ * {_at_code Map} methods, plus support the following additional
requirements.</p>
+ *
+ * <div class="changed_added_2_2">
+ *
+ * <p>The {_at_code Map} implementation must implement {_at_code
java.io.Serializable}.</p>
+ *
+ * <p>Any attempt to add a {_at_code null} key or value must throw a
{_at_code NullPointerException}.</p>
+ *
+ * <p>Any attempt to add a key that is not a {_at_code String} must
+ * throw an {_at_code IllegalArgumentException}.</p>
+ *
+ * </div>
+ *
+ * @param create if <code>true</code>, a new {_at_code Map}
+ * instance will be created if it does not exist already. If
+ * <code>false</code>, and there is no existing
+ * <code>Map</code> instance, one will not be created and
+ * <code>null</code> will be returned.
+ * @return A {_at_code Map} instance, or {_at_code null}.
+ *
+ * @since 2.2
+ */
+
+ public abstract Map<String, Object>
getPassThroughAttributes(boolean create);


How do pass through attributes interact with state saving?

Do additions to the pass through attribute map after
PartialStateHolder.markInitialState() has been called result in partial
state deltas?

It's interesting that we've chosen to add an abstract method here (yay!)
be we are not doing this in other cases where introduce new methods to
abstract base cclasses.

Why is that?

Andy