Thank. It works perfectly by extending GeneralizedFieldHandler

It's a powerful feature but may be a little bit more documented :)

Thanks again.


From: Keith Visco <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [castor-user] -XML- Custom FieldHandler that has access to getter &
Date: Mon, 13 Sep 2004 17:08:35 -0500




Eric,

This information is not accessible via the AbstractFieldHandler.
However, if your intention is to simply invoke the specified getters and
setters, you might want to extend GeneraliedFieldHandler instead of
AbstractFieldHandler. In a GeneralizedFieldHandler castor still invokes
the specified methods, but passes control off to convertUponGet and
convertUponSet methods.

--Keith

"Halcyon62 ." wrote:
>
> Hi all
>
> I'd like to know: how can I setup a custom FieldHandler and have access to
> the get-method and set-method attribute define in the mapping XML file for
> that field.
>
> Exmaple: Here is a part of my mapping.xml
>
> <field
> handler="com.damocles.xml.CustomMaskFieldHandler"
> name="mask" type="string" required="false"
> get-method="getServerMask" set-method="resetServerMask">
> <bind-xml name="server-mask" node="attribute"
> reference="false"/>
> </field>
>
> The class CustomMaskFieldHandler extends
> org.exolab.castor.mapping.AbstractFieldHandler
>
> I overwrote the method setValue and, at runtime, my overwritten method is
> well invoked. The problem is this. I cannot know (or I don't know how to get
> it) the name of the setter method (resetServerMask) that I customized in the
> mapping.xml....
>
> When this class is instantiated, I do not receive this information!
> How can I setup the custom handler to get this information? or is there any
> way to get this information?
>
> Thanks all
>
> Eric
>
> _________________________________________________________________
> Scan and help eliminate destructive viruses from your inbound and outbound
> e-mail and attachments.
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> Start enjoying all the benefits of MSN� Premium right now and get the
> first two months FREE*.
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-user




-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

_________________________________________________________________
Powerful Parental Controls Let your child discover the best the Internet has to offer. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN� Premium right now and get the first two months FREE*.




----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user

Reply via email to