Use an xml (de)serializer to create Java object instead of parsing them by hand

This commit is contained in:
Laurent Clouet
2019-09-03 20:15:46 +02:00
parent 5ed88a240f
commit 96a1b28bc0
12 changed files with 424 additions and 307 deletions

View File

@@ -0,0 +1,60 @@
package com.sheepit.client.datamodel;
import lombok.Getter;
import lombok.ToString;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root(strict = false, name = "job")
@ToString
public class RenderTask {
@Attribute(name = "id")
@Getter
private String id;
@Attribute(name = "use_gpu")
@Getter
private int useGpu;
@Attribute(name = "archive_md5")
@Getter
private String archive_md5;
@Attribute(name = "path")
@Getter
private String path;
@Attribute(name = "frame")
@Getter
private String frame;
@Attribute(name = "synchronous_upload")
@Getter
private String synchronous_upload;
@Attribute(name = "extras")
@Getter
private String extras;
@Attribute(name = "name")
@Getter
private String name;
@Attribute(name = "password")
@Getter
private String password;
@Element(name = "renderer")
@Getter
private RendererInfos rendererInfos;
@Element(name = "script", data = true)
@Getter
private String script;
public RenderTask() {
}
}