|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Binding Java object to XML Datasource GWT I need a little help on a java problem: In one sentence: I want to present the user with the structure of a java object, ie each field values (a toString () will do), and the possibility to browse complex types (lists, maps, etc..). roughly, the view "Variables" of Eclipse I have some technical limitations: JAVA objects (retrieved from a repository running on a jdk1.4) rendering done in a GUI GWT (jdk1.6) my items are quite complex and their structure is not known in advance I begin just my thoughts and at first sight, I am tempted to approach the problem from this angle: 1) GWT likes the datasources in XML. So far I see GWT manipulate an XML describing the object that I must show (form name = attribute name, value = toString () attribute) 2) I must then find a java lib allowing me to generate XML on the fly from a java object passed as parameter, by introspection attributes (or possibly use getters). Any idea? |
#2
| |||
| |||
Re: Binding Java object to XML Datasource GWT xstream, but it only works on server side |
#3
| |||
| |||
Re: Binding Java object to XML Datasource GWT The fact that it runs on the server side does not worry, the very opposite: The manipulation will require a call server side to retrieve the full Java object, so as to make as much as the Transco java-> xml is done server side. Thank you in any case. |
#4
| |||
| |||
Re: Binding Java object to XML Datasource GWT XStream is not bad, I also used JAXB 2 (included in J2EE) and it works very well too. |
#5
| |||
| |||
Re: Binding Java object to XML Datasource GWT OK, thank you, I started watching the side of XStream: Not bad actually, and it can easily highlight the directory structure of a java object as XML. Here, I encountered two limitations of GWT: 1) XML input grid is not an XML "standard" (with n levels) nested XML but a "flat" for each subject with a foreign key to its parent object. Code: <List> − <employee> <EmployeeId>4</EmployeeId> <ReportsTo>1</ReportsTo> <Name>Charles Madigan</Name> <Job>Chief Operating Officer</Job> <Phone>x10962</Phone> <Email>cmadigan@server.com</Email> <OrgUnit>Management</OrgUnit> <Salary>26200.00</Salary> <Gender>male</Gender> <MaritalStatus>married</MaritalStatus> <EmployeeType>full time</EmployeeType> <EmployeeStatus>active</EmployeeStatus> </employee> − <employee> <EmployeeId>192</EmployeeId> <ReportsTo>4</ReportsTo> <Name>Ralph Brogan</Name> <Job>Mgr Software Client Supp</Job> <Phone>x32524</Phone> <Email>rbrogan@server.com</Email> <OrgUnit>Management</OrgUnit> <Salary>13700.00</Salary> <Gender>male</Gender> <MaritalStatus>married</MaritalStatus> <EmployeeType>full time</EmployeeType> <EmployeeStatus>active</EmployeeStatus> </employee> − <employee> <EmployeeId>295</EmployeeId> <ReportsTo>192</ReportsTo> <Name>Bhushan Sambhus</Name> <Job>Line Worker</Job> <Phone>x12125</Phone> <Email>bsambhus@server.com</Email> <OrgUnit>Management</OrgUnit> <Salary>8300.00</Salary> <Gender>female</Gender> <MaritalStatus>married</MaritalStatus> <EmployeeType>part time</EmployeeType> <EmployeeStatus>active</EmployeeStatus> </employee> </List> In short, I must find a way to convert the XML into an XML XStream "GWT compliant" ... and it is not won |
![]() |
|
Tags: binding, gwt, java object, xml |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
get classes and object in java | preeti makkar | Software Development | 1 | 07-05-2012 11:08 AM |
Adding an object in java | Gunner 1 | Software Development | 5 | 27-02-2010 03:20 AM |
How big is an Object in Java? Why Java neglects sizeof? | KALINDA | Software Development | 4 | 10-11-2009 03:19 AM |
How to create object in JAVA | HP_Crook | Software Development | 3 | 09-10-2009 11:52 PM |
Object test = new Object() <-- Java, best way in C++ | ADISH | Software Development | 3 | 25-10-2008 02:32 PM |