faxel.model.Try Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of faxel Show documentation
Show all versions of faxel Show documentation
Faxel is excel to java mapping library.
Using handy annotations, developer no longer need to manually parse excel files.
The newest version!
package faxel.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import faxel.FaxelException;
class Try {
private static Logger LOG = LoggerFactory.getLogger(SheetDefinition.class);
static void onFailureThrowRuntimeException(Tryable r, String message, Object ... args) {
try {
r.tryRun();
} catch (Throwable cause) {
final String formattedMessage = String.format(message, args);
LOG.error("Failed to execute Try {}. {}", cause, formattedMessage);
throw new FaxelException(cause, formattedMessage);
}
}
interface Tryable {
void tryRun() throws Throwable;
}
}