@Root(name = "daemon", strict = false) public class DaemonConfigTO { @Element(name = "webServer", required = false) private WebServerTO webServer = new WebServerTO(); @ElementList(name = "folders", entry = "folder", required = true) private ArrayList<FolderTO> folders = new ArrayList<FolderTO>(); @ElementList(name = "users", entry = "user", required = false) private ArrayList<UserTO> users = new ArrayList<UserTO>();
@Root(name = "testcase") public class TestCaseModel { @Attribute(required = true) public String classname; @Attribute(required = true) public String name; @Attribute(required = true) public double time; @ElementList(inline = true, entry = "failure", required = false, type = FailureModel.class) public List<FailureModel> failures = new ArrayList<>(); @ElementList(inline = true, entry = "error", required = false, type = FailureModel.class) public List<FailureModel> errors = new ArrayList<>(); @NotAnt(extensionSource = "maven") @Element(name = "skipped", required = false) public String skipped; }
@Root(name = "testsuite") public class Testsuite { @Attribute(name = "name") private String name; @Attribute(name = "time") private String time; @ElementList(inline = true) private List<Testcase> testcases = new ArrayList<>(); public Testsuite(Class<?> clazz, double time) { this.name = clazz.getName(); this.time = String.valueOf(time); } public List<Testcase> getTestcases() { return testcases; } public void setTestcases(List<Testcase> testcases) { this.testcases = testcases; } }
/** * This class is just a delegate wrapper around a list. */ @Root public static class BanksProperty { @ElementList IdentifiableList<Bank> banks = new IdentifiableList<>(); }
public class GetFileHistoryFolderResponse extends FolderResponse { @Element(required = true) private String root; @ElementList(required = true, entry="file") private ArrayList<FileVersion> files; public GetFileHistoryFolderResponse(int requestId, String root, List<FileVersion> files) { super(200, requestId, null); this.root = root; this.files = new ArrayList<FileVersion>(files); } public List<FileVersion> getFiles() { return files; } }
public static class Command { @Attribute(required = false) public String headMountableId; @Attribute(required = true) public CommandType type; @ElementList(required = false, inline = true, entry = "text", data = true) public ArrayList<String> commands = new ArrayList<>(); public Command(String headMountableId, CommandType type, String text) { this.headMountableId = headMountableId; this.type = type; setCommand(text); } public void setCommand(String text) { this.commands.clear(); if (text != null) { text = text.trim(); text = text.replaceAll("\r", ""); String[] commands = text.split("\n"); this.commands.addAll(Arrays.asList(commands)); } } public String getCommand() { return Joiner.on('\n').join(commands); } private Command() { } }
public class LogOperationResult implements OperationResult { @ElementList(name = "databaseVersions", entry = "databaseVersion", required = true) private ArrayList<LightweightDatabaseVersion> databaseVersions; public LogOperationResult() { // Nothing } public LogOperationResult(ArrayList<LightweightDatabaseVersion> databaseVersions) { this.databaseVersions = databaseVersions; } public List<LightweightDatabaseVersion> getDatabaseVersions() { return databaseVersions; } }
/** * Constructor for the <code>ElementListLabel</code> object. This * creates a label object, which can be used to convert an XML * node to a <code>Collection</code> of XML serializable objects. * * @param contact this is the contact that this label represents * @param label the annotation that contains the schema details * @param format this is used to style the elements in the list */ public ElementListLabel(Contact contact, ElementList label, Format format) { this.detail = new Introspector(contact, this, format); this.decorator = new Qualifier(contact); this.required = label.required(); this.type = contact.getType(); this.override = label.name(); this.inline = label.inline(); this.entry = label.entry(); this.data = label.data(); this.item = label.type(); this.format = format; this.label = label; }
/** * This is used to provide a configured empty value used when the * annotated value is null. This ensures that XML can be created * with required details regardless of whether values are null or * not. It also provides a means for sensible default values. * * @param context this is the context object for the serialization * * @return this returns the string to use for default values */ public Object getEmpty(Context context) throws Exception { Type list = new ClassType(type); Factory factory = new CollectionFactory(context, list); if(!label.empty()) { return factory.getInstance(); } return null; }
@Root(name = "testcase") public class TestCaseModel { @Attribute(required = true) public String classname; @Attribute(required = true) public String name; @Attribute(required = true) public double time; @ElementList(inline = true, entry = "failure", required = false, type = FailureModel.class) public List<FailureModel> failures = new ArrayList<>(); @ElementList(inline = true, entry = "error", required = false, type = FailureModel.class) public List<FailureModel> errors = new ArrayList<>(); @NotAnt(extensionSource = "maven") @Element(name = "skipped", required = false) public String skipped; }
@Root(name="testcase") public class TestCase { @Attribute private Double time; @Attribute private String name; @ElementList(inline=true, name="testfailures", required=false) private List<TestFailure> testFailures = new ArrayList<TestFailure>();
/** * Used to provide a fixed root for the Packages when serializing. */ @Root(name = "openpnp-packages") public static class PackagesConfigurationHolder { @ElementList(inline = true, entry = "package", required = false) private ArrayList<Package> packages = new ArrayList<>(); }
public class GetDatabaseVersionHeadersFolderResponse extends FolderResponse { @Element(required = true) private String root; @ElementList(required = true, entry="databaseVersionHeader") private ArrayList<DatabaseVersionHeader> databaseVersionHeaders; public GetDatabaseVersionHeadersFolderResponse() { // Nothing } public GetDatabaseVersionHeadersFolderResponse(int requestId, String root, List<DatabaseVersionHeader> databaseVersionHeaders) { super(200, requestId, null); this.root = root; this.databaseVersionHeaders = new ArrayList<DatabaseVersionHeader>(databaseVersionHeaders); } public ArrayList<DatabaseVersionHeader> getDatabaseVersionHeaders() { return databaseVersionHeaders; } }
@Attribute String name; @ElementList(inline=true, name="permission", type=BasicPermission.class) Set<BasicPermission> permissions;
public class ListWatchesManagementResponse extends ManagementResponse { @ElementList(required = true, entry="watch") private ArrayList<Watch> watches; public ListWatchesManagementResponse() { // Nothing } public ListWatchesManagementResponse(int requestId, List<Watch> watches) { super(200, requestId, null); this.watches = new ArrayList<Watch>(watches); } public ArrayList<Watch> getWatches() { return watches; } }
/** * Constructor for the <code>ElementListLabel</code> object. This * creates a label object, which can be used to convert an XML * node to a <code>Collection</code> of XML serializable objects. * * @param contact this is the contact that this label represents * @param label the annotation that contains the schema details * @param format this is used to style the elements in the list */ public ElementListLabel(Contact contact, ElementList label, Format format) { this.detail = new Introspector(contact, this, format); this.decorator = new Qualifier(contact); this.required = label.required(); this.type = contact.getType(); this.override = label.name(); this.inline = label.inline(); this.entry = label.entry(); this.data = label.data(); this.item = label.type(); this.format = format; this.label = label; }
/** * This is used to provide a configured empty value used when the * annotated value is null. This ensures that XML can be created * with required details regardless of whether values are null or * not. It also provides a means for sensible default values. * * @param context this is the context object for the serialization * * @return this returns the string to use for default values */ public Object getEmpty(Context context) throws Exception { Type list = new ClassType(type); Factory factory = new CollectionFactory(context, list); if(!label.empty()) { return factory.getInstance(); } return null; }
@Root(name="Package") public class Manifest { @Attribute(required=false) private String xmlns="http://soap.sforce.com/2006/04/metadata"; @ElementList(inline=true, name="types", required=false) private List<ManifestType> types = new ArrayList<ManifestType>(); @Element private String version = "37.0";