JavaClientCli.ApiCliBase.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codegen Show documentation
Show all versions of codegen Show documentation
This artefact generates other artefacts such as API client, API server out of API Model
{{>licenseInfo}}
package {{invokerPackage}};
import au.org.consumerdatastandards.conformance.ConformanceError;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
public class ApiCliBase {
private static final Logger LOGGER = LoggerFactory.getLogger(ApiCliBase.class);
protected void throwConformanceErrors(List conformanceErrors) throws Exception {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw.println("Received " + conformanceErrors.size() + " errors");
for (ConformanceError conformanceError : conformanceErrors) {
pw.println("Conformance Error: " + conformanceError.getDescription());
}
pw.println("Found a total of " + conformanceErrors.size() + " conformance errors");
throw new Exception(pw.toString());
}
}