- Where Developers Learn, Share, & Build Careers
I have successfully used JAXB to make some XML file uncompressed but I have another case Is more complex. Basically my XML file looks like this: It's basically a I was thinking about having two adapters, the second would be called by the first adapter, but I did not feel comfortable with that solution. How to pull it off? PD: Funny story I can not say hello at the beginning of the post, the system keeps pressing it! You can create / use a generic adapter for the map instead of & lt; K, V & gt; instead of creating two adapters. / P> & lt; BCLCurrenciesInflation & gt; & Lt; CurrenciesInflation & gt; & Lt; Currency & gt; & Lt; CurencyName & gt; Yen & lt; / CurencyName & gt; & Lt; COUNTRYNAME & gt; Japan & lt; / COUNTRYNAME & gt; & Lt; IssuingDate & gt; 1900/01/01 & lt; / IssuingDate & gt; & Lt; ExpirationDate & gt; & Lt; / ExpirationDate & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1900 & lt; / Year & gt; & Lt; Percentage & gt; 16 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1901 & lt; / Year & gt; & Lt; Percentage & gt; 17 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; / Currency & gt; & Lt; Currency & gt; & Lt; CurencyName & gt; Dollar & lt; / CurencyName & gt; & Lt; COUNTRYNAME & gt; United States & lt; / COUNTRYNAME & gt; & Lt; IssuingDate & gt; 1900/01/01 & lt; / IssuingDate & gt; & Lt; ExpirationDate & gt; & Lt; / ExpirationDate & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1902 & lt; / Year & gt; & Lt; Percentage & gt; 18 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1903 & lt; / Year & gt; & Lt; Percentage & gt; 19 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; / Currency & gt; & Lt; / CurrenciesInflation & gt;
hashmap
public class BCLCurrency {@XmlElement (name = "currencyName") the name of the public string; @ XMLElement (name = "countryname") public string country; @ XMLElement (name = "issuing") date of issue of public string; @ XmlElement (name = "expiration date") public string end date; @ XMLElement (name = "inflation") public map & lt; String, float & gt; InflationMap; }
Comments
Post a Comment