org.liblouis.TranslationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liblouis-java Show documentation
Show all versions of liblouis-java Show documentation
JNA based Java bindings to liblouis, an open-source braille translator and back-translator.
The newest version!
package org.liblouis;
import java.util.List;
@SuppressWarnings("serial")
public class TranslationException extends Exception {
public TranslationException(String message) {
super(message);
}
public TranslationException(String message, List errors) {
this(addErrorsToMessage(message, errors));
}
public TranslationException(Throwable throwable) {
super(throwable);
}
public TranslationException(String message, Throwable throwable) {
super(message, throwable);
}
private static String addErrorsToMessage(String message, List errors) {
if (errors != null && !errors.isEmpty()) {
message += "\nErrors:";
for (String e : errors)
message += ("\n" + e);
}
return message;
}
}