commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "German Balbastro" <germ...@Synthesis-RS.com>
Subject RE: Digester and Inheritance
Date Wed, 09 Aug 2006 18:13:40 GMT
Yes, the class have the getter and setter methods, but i donĀ“t know how to access to the properties
of the parent tags in the xml file.

-----Mensaje original-----
De: James Carman [mailto:james@carmanconsulting.com] 
Enviado el: Wednesday, August 09, 2006 2:47 PM
Para: 'Jakarta Commons Users List'
Asunto: RE: Digester and Inheritance

Since Class2 extends Class1, it inherits the properties of Class1.  Digester
will be able to set the properties for you with no problems.  You did
actually give those properties setters/getters, didn't you?



-----Original Message-----
From: German Balbastro [mailto:germanb@Synthesis-RS.com] 
Sent: Wednesday, August 09, 2006 1:40 PM
To: Jakarta Commons Users List
Subject: RE: Digester and Inheritance

Yes, I don't know how to creates an instance of Class2 when found the
tag Class2 and set the properties of class1 in Class2.
For example:
Class Class1{
String code
}
Class Class2 extends Class1{
String name;
}
Class Class3 extends Class1{
String type;
}
And de xml:
<Class1> 
    <code>1</code>
    <Class2> 
       <name>test</name>
    </ Class2> 
</Class1>
<Class1> 
    <code>2</code>
    <Class3> 
       <type>aType</type>
    </ Class3> 
</Class1>
My generate object class2 need to have both properties setted (code=1
and name=test) and the object class3 = {code=2, tye=atype}

-----Mensaje original-----
De: James Carman [mailto:james@carmanconsulting.com] 
Enviado el: Wednesday, August 09, 2006 2:29 PM
Para: 'Jakarta Commons Users List'
Asunto: RE: Digester and Inheritance

Can't you add a create rule with a path of Class1/Class2 for Class2 and
a
create rule for Class1/Class3 for Class3?


-----Original Message-----
From: German Balbastro [mailto:germanb@Synthesis-RS.com] 
Sent: Wednesday, August 09, 2006 1:19 PM
To: commons-user@jakarta.apache.org
Subject: Digester and Inheritance

I have an object model whith an abstract parent class Class1 and two
implementations Class2 and Clas3.

I don't know how i can create the implementations.

For example i have this xml file:

<Class1> 
    ... fields of class1 ...
    <Class2> 
       ... fields of class2 ...

    </ Class2> 
</ Class1> 
<Class1> 
    ... fields of class1 ...
    <Class3> 
       ... fields of class3 ...

    </ Class3> 
</ Class1> 
For this example, digester should create one instance of Class2 and one
instance of Class3, and in both cases setter the attributes for the
class and for inheritance for the parent class.

I need to know how to create the digester's rules.

Thanks

 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message