[xstream-user] Reuse xml tag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[xstream-user] Reuse xml tag

falcorn
Hi. I have to deserialize xml like this:
<contact>
    <contactId> blebleble</contactId>
    .....
    <someObjects>
       <Object>
          <data1></data1>
          <data2></data2>
       </Object>
       <Object>
          <data1></data1>
          <data2></data2>
       </Object>
       .....
    </someObjects>
</contact>

and class
and classes
class Contact{
    String contactId
    ...
    List someObjects

    class Object
    {
        String contactId
        String data1
        String data 2
    ...
    }
}

I need to use contactId in function in class Object.
It should be the same like in class Contact
How i can do it?




----------------------------------------------------------------------
Facet, Kobieta, Samochody, Randki... >>> http://link.interia.pl/f18d2

Reply | Threaded
Open this post in threaded view
|

RE: [xstream-user] Reuse xml tag

Williams, Paul C. (LNG-SAC)
Use the following construct:

class Contact{
    String contactId
    ...
    List someObjects

    class Object
    {
         String data1
        String data 2
    ...
        String getContactId() { return Contact.this.contactId; }
    }
}

-----Original Message-----
From: Piotr Idzikowski [mailto:[hidden email]]
Sent: Friday, November 04, 2005 8:51 AM
To: [hidden email]
Subject: [xstream-user] Reuse xml tag

Hi. I have to deserialize xml like this:
<contact>
    <contactId> blebleble</contactId>
    .....
    <someObjects>
       <Object>
          <data1></data1>
          <data2></data2>
       </Object>
       <Object>
          <data1></data1>
          <data2></data2>
       </Object>
       .....
    </someObjects>
</contact>

and class
and classes
class Contact{
    String contactId
    ...
    List someObjects

    class Object
    {
        String contactId
        String data1
        String data 2
    ...
    }
}

I need to use contactId in function in class Object.
It should be the same like in class Contact How i can do it?




----------------------------------------------------------------------
Facet, Kobieta, Samochody, Randki... >>> http://link.interia.pl/f18d2