Class SafeCalling
java.lang.Object
com.itextpdf.signatures.validation.SafeCalling
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidonExceptionLog(ThrowingAction action, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.static <T> TonExceptionLog(ThrowingSupplier<T> action, T defaultValue, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.static voidonRuntimeExceptionLog(Action action, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.static <T> TonRuntimeExceptionLog(Supplier<T> action, T defaultValue, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.
-
Constructor Details
-
SafeCalling
private SafeCalling()
-
-
Method Details
-
onExceptionLog
public static void onExceptionLog(ThrowingAction action, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.- Parameters:
action- The action to performreport- The report to add the ReportItem toreportItemCreator- A callback to generate a ReportItem
-
onExceptionLog
public static <T> T onExceptionLog(ThrowingSupplier<T> action, T defaultValue, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.- Type Parameters:
T-- Parameters:
action- The action to performdefaultValue- The value to return when an exception is thrownreport- The report to add the ReportItem toreportItemCreator- A callback to generate a ReportItem- Returns:
- The returned value from the action
-
onRuntimeExceptionLog
public static void onRuntimeExceptionLog(Action action, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.- Parameters:
action- The action to performreport- The report to add the ReportItem toreportItemCreator- A callback to generate a ReportItem
-
onRuntimeExceptionLog
public static <T> T onRuntimeExceptionLog(Supplier<T> action, T defaultValue, ValidationReport report, Function<Exception, ReportItem> reportItemCreator) Adds a report item to the report when an exception is thrown in the action.- Type Parameters:
T-- Parameters:
action- The action to performdefaultValue- The value to return when an exception is thrownreport- The report to add the ReportItem toreportItemCreator- A callback to generate a ReportItem- Returns:
- The returned value from the action
-