xml - Drop-in replacement for java.beans.XMLEncoder -


i've got lots xsl transforms rely on java.beans.xmlencoder xml format, , i'm wondering if can find drop-in replacement lib has better performance. i've looked @ xstream serialization format different.

i'm looking replace i'm working legacy codebase has forked version of xmlencoder , i'd return more standard, java.beans.xmlencoder has worse performance.

for class person (with appropriate getters , setters):

public class person {     private string name;     private list<string> favoritecolors;     private date birthdate;     private int age; } 

xmlencoder produces xml following:

<?xml version="1.0" encoding="utf-8"?> <java version="1.8.0_66" class="java.beans.xmldecoder">  <object class="person" id="person0">   <void property="age">    <int>40</int>   </void>   <void property="birthdate">    <object class="java.util.date">     <long>175064400000</long>    </object>   </void>   <void property="favoritecolors">    <void method="add">     <string>red</string>    </void>    <void method="add">     <string>green</string>    </void>   </void>   <void property="name">    <string>john doe</string>   </void>  </object> </java> 

i'm guessing possible create bunch of xstream converters approximate format i'm wondering if there's easier solution before head down rabbit hole.

in case else runs across later, implementing via xstream there long don't care order of elements. deeper implementation allows control order of elements, ended scrapping idea , i'm going deal until can re-write code in question.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -