1 package org.sonar.updatecenter.deprecated;
3 import com.thoughtworks.xstream.XStream;
4 import com.thoughtworks.xstream.annotations.XStreamAlias;
5 import com.thoughtworks.xstream.annotations.XStreamImplicit;
7 import java.util.Arrays;
11 * Information about updates.
13 * @author Evgeny Mandrikov
15 @XStreamAlias("updateInfo")
16 public class UpdateInfo {
20 @XStreamImplicit(itemFieldName = "plugin")
21 public List<Plugin> plugins;
23 public UpdateInfo(Sonar sonar, List<Plugin> plugins) {
25 this.plugins = plugins;
28 public static void main(String[] args) {
29 XStream xstream = new XStream();
30 xstream.autodetectAnnotations(true);
32 Plugin plugin = new Plugin("sonar-test-plugin");
33 plugin.setVersion("0.1");
34 plugin.setName("Sonar Test Plugin");
35 plugin.setDescription("Test");
36 plugin.setHomepage("http://homepage");
37 plugin.setDownloadUrl("http://download");
38 plugin.setRequiredSonarVersion("2.0");
40 System.out.println(xstream.toXML(new UpdateInfo(new Sonar("2.0"), Arrays.asList(plugin))));