You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Petr Nejedlík <pe...@abra.eu> on 2009/05/27 09:59:36 UTC

ComponentModel

Hi,

Class ComponentModel in version 1.4rc4 is generic but setObject methods
still use Object instead of T.
Is there any reason why setObject methods in ComponentModel and in inner
class WrapModel does not use type T as input parameter?

I recommend to change from

    public final void setObject(Object object)
    {
        throw new RuntimeException("set object call not expected on a
IComponentAssignedModel");
    }

to

    public final void setObject(T object)
    {
        throw new RuntimeException("set object call not expected on a
IComponentAssignedModel");
    }

and this

    protected void setObject(Component component, Object object)
    {
    }

to

    protected void setObject(Component component, T object)
    {
    }

and this

        /**
         * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
         */
        public void setObject(Object object)
        {
            ComponentModel.this.setObject(component, object);
        }

to

        /**
         * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
         */
        public void setObject(T object)
        {
            ComponentModel.this.setObject(component, object);
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: ComponentModel

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Please open a JIRA so it doesn't get lost.

--
Jeremy Thomerson
http://www.wickettraining.com




On Wed, May 27, 2009 at 2:59 AM, Petr Nejedlík <pe...@abra.eu> wrote:
> Hi,
>
> Class ComponentModel in version 1.4rc4 is generic but setObject methods
> still use Object instead of T.
> Is there any reason why setObject methods in ComponentModel and in inner
> class WrapModel does not use type T as input parameter?
>
> I recommend to change from
>
>    public final void setObject(Object object)
>    {
>        throw new RuntimeException("set object call not expected on a
> IComponentAssignedModel");
>    }
>
> to
>
>    public final void setObject(T object)
>    {
>        throw new RuntimeException("set object call not expected on a
> IComponentAssignedModel");
>    }
>
> and this
>
>    protected void setObject(Component component, Object object)
>    {
>    }
>
> to
>
>    protected void setObject(Component component, T object)
>    {
>    }
>
> and this
>
>        /**
>         * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
>         */
>        public void setObject(Object object)
>        {
>            ComponentModel.this.setObject(component, object);
>        }
>
> to
>
>        /**
>         * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
>         */
>        public void setObject(T object)
>        {
>            ComponentModel.this.setObject(component, object);
>        }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org