Setting default type for arrays.

24 views
Skip to first unread message

Nemesis Mate

unread,
Jun 28, 2016, 5:08:49 AM6/28/16
to yamlbeans-users
I'm having some problems finding the way this can be achieved (I don't even know if it's possible). What I would like to make is to set the default type of an array, just like with any collection, so I can use:

writer.getConfig().setProperyDefaultType(MyClass.class, "array", CustomType.class);

or

writer.getConfig().setProperyElementType(MyClass.class, "array", CustomType.class); // This one works if "array" is an ArrayList, but not with a raw array.

Thanks for any help.

(With the 1.08 version I was cheating the serializer making the attribute private and the get/set methods use an arraylist while internally it was an array. Not working anymore with the 1.09. However, it was a patch and I would like to use arrays directly)
Reply all
Reply to author
Forward
0 new messages