On Aug 31, 2016, at 4:15 PM, Wojciech Potiopa <wojciech...@gmail.com> wrote:Hi I'm having fun serializing/deserializing objects to/from xml, Thing is, serialization should be generic and produce XML like this
<Data>
<Entity type="com.voitech.serializer.xmltest.data.TestData">
<Property name="id">
<Simple type="ceylon.language::Integer">123</Simple>
</Property>
<Property name="name">
<Simple type="ceylon.language::String">test name</Simple>
</Property>
</Entity>
</Data>
Of course for classes with arguments, there will be other attributes or XML elements. Is there way in Ceylon to find ClassDeclaration by name and then initiallize class models with generic arguments provided (or not) ?
Something like
ClassDeclaration stringDeclaration=findClassDeclaration("ceylon.language::String");
ClassModel<Anything,Anything> classModel=initModel<Anything>(stringDeclaration);
Anything str=classModel.defaultConstructor.call(args)...
Thanks
Wojciech.--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/87c3e457-2848-4267-bead-664e81058b80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/28545DB9-C8DB-4AA1-BC63-399F11A5A8A3%40vasileff.com.
This might be what you're looking for
Hth,
Tom
Hi I'm having fun serializing/deserializing objects to/from xml, Thing is, serialization should be generic and produce XML like this--
<Data>
<Entity type="com.voitech.serializer.xmltest.data.TestData">
<Property name="id">
<Simple type="ceylon.language::Integer">123</Simple>
</Property>
<Property name="name">
<Simple type="ceylon.language::String">test name</Simple>
</Property>
</Entity>
</Data>
Of course for classes with arguments, there will be other attributes or XML elements. Is there way in Ceylon to find ClassDeclaration by name and then initiallize class models with generic arguments provided (or not) ?
Something like
ClassDeclaration stringDeclaration=findClassDeclaration("ceylon.language::String");
ClassModel<Anything,Anything> classModel=initModel<Anything>(stringDeclaration);
Anything str=classModel.defaultConstructor.call(args)...
Thanks
Wojciech.
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.