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

org.liblouis.TranslationException Maven / Gradle / Ivy

Go to download

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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy