Thanks Keith,

Three questions:

1) Are you suggesting that I simply implement the abstract methods in
GeneralizedFieldHandler, or that I overide the getValue and setValue?
2) Is my understanding correct that the "convertUponGet" method is called
after my getter is called (and hence after my RuntimeException has made
parsing fail unless I overload the get/setValue methods)?
3) Do you know somewhere I could look for documentation or an example?

Thanks again,

Scott


    public final Object getValue(Object object)
        throws IllegalStateException
    {
        if(_handler == null)
            throw new IllegalStateException("A call to #setFieldHandler
(with a non-null value) must be made before calling this method.");
        else
            return convertUponGet(_handler.getValue(object));
    }





                                                                                       
                                              
                      Keith Visco                                                      
                                              
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]            
                                           
                      om>                      cc:                                     
                                              
                                               Subject:  Re: [castor-dev] IDL Enums 
Revisited                                        
                      07/18/03 04:35 PM                                                
                                              
                      Please respond to                                                
                                              
                      castor-dev                                                       
                                              
                                                                                       
                                              
                                                                                       
                                              





Hi Scott,

You can extend GeneralizedFieldHandler to do the checking for you, and
simply specify this field handler for the specific field(s) in the
mapping file.

--Keith

[EMAIL PROTECTED] wrote:
>
> Hi All,
>
> There was a thread on this list about a year ago regarding CORBA Enums
> which was never really answered, so I'd like to bring it back up.
>
> I have a class (a CORBA Enumeration) which has several getters, only one
of
> which is valid per object.  There are other getters on the object that
tell
> you which getter is valid.
>
> If an invalid getter is called, a RuntimeException is thrown.  Is there
any
> way I can set up my mapping.xml file to
>
> a) only call the proper getter when generating XML
>  -- and --
> b) only call the proper setter when creating an object from the XML
>
> Thanks for you help,
>
> Scott
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

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

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

Reply via email to