the beaninfo is all in the parent class - Component...

--Stacy
  ----- Original Message ----- 
  From: dIon Gillard 
  To: Struts Users Mailing List 
  Sent: Saturday, March 02, 2002 8:06 PM
  Subject: Re: Digester and inheritance


  Stacy Weng wrote:

  >I have a parent class called Component, and several child classes extending from 
it.   All the common get/set methods are defined in Component.  So, after each child 
is getting created from addObjectCreate() method, I call addSetProperties() method to 
initialize their values (values are from the xml file), however, digester can't find 
the set methods from the child class, cause they're defined in the parent class 
(Component).  The temporary solution I had was defining those set methods in the child 
classes, and have them call the super methods.  But that seems to defeat the whole 
purpose of inheritance.  Here's an example with the problem:
  >
  >public class Component {
  >    public String name = null;
  >    public void setName(String name) {
  >        this.name=name;
  >    }
  >    public void getname() {
  >        return this.name;
  >    }
  >}
  >
  >public class ChildClass extend Component {
  >    //Other methods that differ from parent class
  >}
  >
  Do you have any beaninfo classes coded/generated for ChildClass?

  >
  >for the digester rules:
  >
  >digester.addObjectCreate("ChildClassPattern", "some.package.ChildClass");
  >digester.addSetProperties("ChildClassPattern");
  >
  >so, as it gets to addSetProperties(), it doesn't see any of the get/set methods in 
ChildClass, and yet, it doesn't know to look its parent class, Component.
  >
  >I hope I'm able to get my problem across.  Thanks again for taking the time to 
respond.
  >
  >--Stacy
  >
  -- 
  dIon Gillard, Multitask Consulting
  http://adslgateway.multitask.com.au/developers




  --
  To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
  For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to