You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Vikram Rayabhari <vi...@yasutech.com> on 2002/02/13 17:30:06 UTC

BeanSerializer and null properties

I have a property in a bean that is declared as

private MyInterface intf;

This property is always null and will never change in my application.
Currently the BeanSerializer is very strict ie it expects a type mapping
for MyInterface even though the value is null. This means that I will
have to write a dummy class which implements MyInterface, and then add a
mapping for this.

Could the BeanSerializer be changed so that it takes care of serializing
null properties(just like it does for primitives) and throws an
exception only when a non-null property has no mapping registered for
it?

Vikram

Re: BeanSerializer and null properties

Posted by Vikram Rayabhari <vi...@yasutech.com>.
oops... its BeanDeserializer that throws the exception. The serializer
seems to work fine.

Vikram Rayabhari wrote:

> I have a property in a bean that is declared as
>
> private MyInterface intf;
>
> This property is always null and will never change in my application.
> Currently the BeanSerializer is very strict ie it expects a type
> mapping for MyInterface even though the value is null. This means that
> I will have to write a dummy class which implements MyInterface, and
> then add a mapping for this.
>
> Could the BeanSerializer be changed so that it takes care of
> serializing null properties(just like it does for primitives) and
> throws an exception only when a non-null property has no mapping
> registered for it?
>
> Vikram