Mesut Celik wrote:
hi keith,

what about the mapping.xml file? Actually I had written an
GeneralizedFieldHandler without handlerFactory and then assigned the
handler to some fields in the mapping file before your mail and it did
not work.


How did you specify your handler and what does your handler implementation look like? Did you take a look at the online documentation for writing custom handlers?

my question is you did not mention about mapping file in
your mail. dont I have to use mapping file? and what should i do if i
need only some fields to be handled and not the others?

Yes you can use a mapping file, which is the normal way to specify custom handlers, but if you wanted to handle all Boolean values in your application the same way then it's easier to write a FieldHandlerFactory. If you only want some values to be handled a certain way, then a mapping file is the better approach.

--Keith


thanks in advance,
mesut

On 10/8/05, Keith Visco <[EMAIL PROTECTED]> wrote:

Mesut,

You can write a GeneralizedFieldHandler and a FieldHandlerFactory. The
FieldHandlerFactory will prevent you from having to specify your
GeneralizedFieldHandler on every field that is a boolean. You can set
the FieldHandlerFactory directly on the Introspector as such:

  Marshaller m = new Marshaller(writer);
  ClassDescriptorResolverImpl cdr = new ClassDescriptorResolverImpl();
  cdr.getIntrospector().addFieldHandlerFactory(factory);
  m.setResolver(cdr);

Hope that helps,

--Keith

Mesut Celik wrote:

Hi all,

I wanna serialize boolean values of my objects as 0/1. I think one
possible way of doing so is writing Generalized Field handler.
Is there any other approach? or what is the best solution for such an issue?

regards,
mesut

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to