All Downloads are FREE. Search and download functionalities are using the official Maven repository.

JavaClientCli.ApiCliBase.mustache Maven / Gradle / Ivy

Go to download

This artefact generates other artefacts such as API client, API server out of API Model

There is a newer version: 1.1.1
Show newest version
{{>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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy