Hi!
I have the following application:
Part 1: A developer describes a (complex) data structure using schema and JAXB. (The result are Java classes and methods that allow data access)
Part 2: A developer describes a generic GUI using an XML based description. (Besides XML the description elements are proprietary)
Part 3: An application reads the GUI specification from part two and creates all kind of controls in a dialog window (e.g. JTextField, JComboBox, JCheckBox etc.).
Part 4: If a user now interacts with the GUI the data entered into the controls should be persistet into the data structure of part one.
The problem here is the binding between the GUI generator (part three) and the data structure in part one. The solution to this problem so far is a bridging class that can be specified in the GUI description (part two) and is interpreted using introspection / reflection at runtime. The problem here is that the developer has to implement a bridging method for every thinkable transaction (at least the setter and getter methods). This is quite uncomfortable and time consuming.
So I was wondering since the description of the datastructure is available as a schema and a set with default values as XML, if I could not use the reflection / introspection to call the get and set methods directly. All I found so far where Mickey Mouse examples that don't apply to my problem (or I am not able to apply them). The best link to the problem I found was https://jaxb2-reflection.dev.java.net/ . The main problem is that the class structure is nested and that there are lists involved.
To clarify the problem some sniplets from the definition files in part two
<ComboBox
id="cbxVPTitel"
enabled="true"
data-table="method name to read list definition"
data-init="method name to init the UI control"
data-get="get method name"
data-set="set method name"
visible="true"
label-position="left"
/>
Instead of the method names I would like either be able to specify direclty which methods to call or an XPath expression that can be converted into the appropriate classes and methods.