users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: UIComponent API review

From: Edward Burns <edward.burns_at_oracle.com>
Date: Fri, 15 Mar 2013 19:56:48 -0700

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

AS> Review comments for UIComponent...
AS> Index: javax/faces/component/UIComponent.java
AS> ===================================================================
AS> --- javax/faces/component/UIComponent.java (revision 8845)
AS> +++ 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";

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

We only added it in 2.1. If we're going to deprecated it, we'd need to
say why. Let's deprecate it in 2.3. Can you please file that issue?

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

AS> How do pass through attributes interact with state saving?

I have documented the existing implementation strategy: using
getStateHelper().

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

Yes, per the usual StateHelper contract.

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

AS> Why is that?

That was an oversight. Thanks for catching it.

I've made it return the empty map in the base class.

r11755

Ed