开发者

Transform any ActionScript class in XML

开发者 https://www.devze.com 2023-04-09 19:30 出处:网络
For a program i\'m writing I need to marshal ActionScript classes to a format that is later to be read by Java (and back again).

For a program i'm writing I need to marshal ActionScript classes to a format that is later to be read by Java (and back again). What solutions exists for such a need ?

Is there a way (like when using Java through XMLEncoder/XMLDecoder) to generate that XML using standard flex libraries (that would be compatible with later decoding using XMLDecoder) ? Or is there a good existing library ?

EDIT Yes, this question is a duplicate of Are there any tool 开发者_开发知识库mapping of JavaBeans to ActionScript Class through xml serialization and deserialization?, but I will accept correct answers and eventually start a bounty if no answer satisfies my needs. (in other words, i plan to make the previous - unanswered - question a duplicate of mine).

EDIT 2 To be even more precise, I have an application divided in two parts : one Flex GUI and one Java core. They communicate over a non http layer which requires data to be sent in XML. In this context, I replicated my Java objects in Flex (using GAS3) and now want some of these objects to be sent from Flex to Java and back again. For that purpose, I have to serialize objects (on the Flex end) in XML and deserialize them in Java (and all that back again).


We are using http://www.spicefactory.org/parsley/index.php which supports XML-to-object conversions back-and-forth. Their documentation is very decent: http://www.spicefactory.org/parsley/docs/2.4/manual/.


See describeType function if you really want XML. But I seriously recommend considering the other serializations formats too.

You can look into JSON. The classes needed for the actionscript serialization/deserialization are part of the as3corelib library.

You might also want to take a look at BlazeDS.


Solution used was to put XStream on the java side and FleXMLer (with some adaptations that can be found there : https://github.com/Riduidel/FleXMLer) on the Flex side. it works quite good (once FleXMLer is adapted to XStream architecture).

0

精彩评论

暂无评论...
验证码 换一张
取 消