@Root(name = "retCancNFe") public class NFRetornoCancelamento extends DFBase { private static final long serialVersionUID = 93128697872980852L; @Attribute(name = "versao", required = false) private String versao; @Element(name = "infCanc") private NFRetornoInfoCancelamento infoCancelamento; public NFRetornoInfoCancelamento getInfoCancelamento() { return this.infoCancelamento; } public void setInfoCancelamento(final NFRetornoInfoCancelamento infoCancelamento) { this.infoCancelamento = infoCancelamento; } public String getVersao() { return this.versao; } public void setVersao(final String versao) { this.versao = versao; } }
@Root(name = "appInfoResponse") public class AppInfoResponse { @Element(name = "code", required = true) private int code; @Element(name = "message", required = true) private String message; @ElementList(name = "appInfoList", required = true) private ArrayList<AppInfo> appInfoList;
/** * Used to provide a fixed root for the Parts when serializing. */ @Root(name = "openpnp-parts") public static class PartsConfigurationHolder { @ElementList(inline = true, entry = "part", required = false) private ArrayList<Part> parts = new ArrayList<>(); } }
@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; } }
/** * A message is either a request or a response sent to * or from the daemon. All messages must inherit from this * class. Messages can be serialized/deserialized using the * {@link MessageFactory}. * * @author Philipp C. Heckel <philipp.heckel@gmail.com> */ @Root(strict = false) public abstract class Message { // Nothing here. }
/** * This is used to set the optional <code>Root</code> annotation for * the class. The root can only be set once, so if a super type also * has a root annotation define it must be ignored. * * @param label this is the label used to define the root */ private void root(Annotation label) { if(label != null) { Root value = (Root)label; String real = type.getSimpleName(); String text = real; if(value != null) { text = value.name(); if(isEmpty(text)) { text = Reflector.getName(real); } strict = value.strict(); root = value; name = text; } } }
/** * This will acquire the name of the <code>Root</code> annotation * for the specified class. This will traverse the inheritance * hierarchy looking for the root annotation, when it is found it * is used to acquire a name for the XML element it represents. * * @param real the actual type of the object being searched * @param type this is the type to acquire the root name with * * @return the root name for the specified type if it exists */ private String getRoot(Class<?> real, Class<?> type) { String name = type.getSimpleName(); Root root = type.getAnnotation(Root.class); if(root != null) { String text = root.name(); if(!isEmpty(text)) { return text; } return Reflector.getName(name); } return null; }
@Root(name = "protNFe") public class NFProtocolo extends DFBase { private static final long serialVersionUID = -784305871769382618L; @Attribute(name = "versao", required = true) private String versao; @Element(name = "infProt", required = true) private NFProtocoloInfo protocoloInfo; public void setVersao(final String versao) { this.versao = versao; } public void setProtocoloInfo(final NFProtocoloInfo protocoloInfo) { this.protocoloInfo = protocoloInfo; } public NFProtocoloInfo getProtocoloInfo() { return this.protocoloInfo; } public String getVersao() { return this.versao; } }
@Root(name = "transaction", strict = false) public class TransactionTO { @Element(name = "machineName") private String machineName; @ElementList(name = "actions", entry = "action") private ArrayList<ActionTO> actionTOs;
/** * This class is just a delegate wrapper around a list. */ @Root public static class BanksProperty { @ElementList IdentifiableList<Bank> banks = new IdentifiableList<>(); }
@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>();
/** * Internal events are {@link Event}s meant for JVM-local consumers. * * <p>In particular, they are not to be broadcasted to external subscribers, * such as GUIs connected via WS, but only to the local event bus. * * @author Philipp C. Heckel <philipp.heckel@gmail.com> */ @Root public abstract class InternalEvent extends Event { // Marker }
/** * This is used to set the optional <code>Root</code> annotation for * the class. The root can only be set once, so if a super type also * has a root annotation define it must be ignored. * * @param label this is the label used to define the root */ private void root(Annotation label) { if(label != null) { Root value = (Root)label; String real = type.getSimpleName(); String text = real; if(value != null) { text = value.name(); if(isEmpty(text)) { text = Reflector.getName(real); } strict = value.strict(); root = value; name = text; } } }
/** * This will acquire the name of the <code>Root</code> annotation * for the specified class. This will traverse the inheritance * hierarchy looking for the root annotation, when it is found it * is used to acquire a name for the XML element it represents. * * @param real the actual type of the object being searched * @param type this is the type to acquire the root name with * * @return the root name for the specified type if it exists */ private String getRoot(Class<?> real, Class<?> type) { String name = type.getSimpleName(); Root root = type.getAnnotation(Root.class); if(root != null) { String text = root.name(); if(!isEmpty(text)) { return text; } return Reflector.getName(name); } return null; }
@Root(name = "retCancNFe") public class NFRetornoCancelamento extends DFBase { private static final long serialVersionUID = 93128697872980852L; @Attribute(name = "versao", required = false) private String versao; @Element(name = "infCanc") private NFRetornoInfoCancelamento infoCancelamento; public NFRetornoInfoCancelamento getInfoCancelamento() { return this.infoCancelamento; } public void setInfoCancelamento(final NFRetornoInfoCancelamento infoCancelamento) { this.infoCancelamento = infoCancelamento; } public String getVersao() { return this.versao; } public void setVersao(final String versao) { this.versao = versao; } }