JAXB usage?

26 views
Skip to first unread message

Thomas

unread,
Aug 13, 2018, 10:31:28 PM8/13/18
to CodenameOne Discussions
Is it possible to use JAXB in CN1 to bind some XML xs scheme file (downloaded by the app) onto some classes of the the app? Or do I have to write a custom parser by hand ?


If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

Shai Almog

unread,
Aug 14, 2018, 12:21:18 AM8/14/18
to CodenameOne Discussions
No. I don't want to say it's completely impossible but it would be remarkably hard because jaxb relies on reflection/bytecode manipulation. Both are challenging on Android (due to obfuscation) and iOS (due to native compilation).

It should be easy/possible to map XML to property objects, this would result in a far superior experience to jaxb. It won't fail on devices and would work with obfuscation/compilation. It would easily map to other formats (e.g. JSON) and would offer other cool features such as UI binding etc. https://www.codenameone.com/blog/properties-are-amazing.html

We didn't implement this but it's probably not a lot of work...
Reply all
Reply to author
Forward
0 new messages