Package org.apache.jena.riot.system
Class ErrorHandlerFactory
- java.lang.Object
-
- org.apache.jena.riot.system.ErrorHandlerFactory
-
public class ErrorHandlerFactory extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ErrorHandlerFactory.ErrorHandlerRecorder
An error handler that counts errors and warnings.static class
ErrorHandlerFactory.ErrorHandlerTracking
An error handler that logs message for errors and warnings and throw exceptions on either
-
Field Summary
Fields Modifier and Type Field Description static ErrorHandler
errorHandlerNoLogging
Silent error handler : ignores warnings, throws exceptions for errorsstatic ErrorHandler
errorHandlerNoWarnings
Error handler (no warnings) - logs to stdLoggerstatic ErrorHandler
errorHandlerStd
Standard error handler - logs to stdLoggerstatic ErrorHandler
errorHandlerStrict
Strict error handler - logs to stdLogger - exceptions for warningsstatic ErrorHandler
errorHandlerStrictNoLogging
Silent, strict error handlerstatic ErrorHandler
errorHandlerWarn
Warning error handler - logs to stdLogger - messages for warnings and some errorsstatic org.slf4j.Logger
noLogger
static org.slf4j.Logger
stdLogger
-
Constructor Summary
Constructors Constructor Description ErrorHandlerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ErrorHandler
errorHandlerDetailed()
Deprecated.Use {#errorHandlerExceptionOnError}static ErrorHandler
errorHandlerExceptionOnError()
An error handler that throws aRiotParseException
, hence it exposes the details of errors.static ErrorHandler
errorHandlerExceptions()
An error handler that throws exceptions in all cases.static ErrorHandler
errorHandlerIgnoreWarnings(org.slf4j.Logger log)
An error handler that logs error and fatal messages, but not warningsstatic ErrorHandler
errorHandlerSimple()
Ignores warnings, throws exceptions for errorsstatic ErrorHandler
errorHandlerStd(org.slf4j.Logger log)
An error handler that logs messages, then throws exceptions for errors but not warningsstatic ErrorHandler
errorHandlerStrict(org.slf4j.Logger log)
Strict error handler, with loggingstatic ErrorHandler
errorHandlerStrictSilent()
Silent, strict error handler, no loggingstatic ErrorHandlerFactory.ErrorHandlerTracking
errorHandlerTracking(org.slf4j.Logger log, boolean failOnError, boolean failOnWarning)
Logs warnings and errors while tracking the counts of each and optionally throwing exceptions when errors and/or warnings are encountedstatic ErrorHandler
errorHandlerWarning(org.slf4j.Logger log)
An error handler that logs messages for errors and warnings and attempts to carry onstatic ErrorHandler
errorHandlerWarnOrExceptions(org.slf4j.Logger logger)
An error handler that logs warnings and throws exceptions on error and fatal.static ErrorHandler
getDefaultErrorHandler()
Get the current default error handlerstatic void
setDefaultErrorHandler(ErrorHandler errorHandler)
Set the current default error handler - use carefully, mainly for use in testing
-
-
-
Field Detail
-
stdLogger
public static final org.slf4j.Logger stdLogger
-
noLogger
public static final org.slf4j.Logger noLogger
-
errorHandlerStd
public static final ErrorHandler errorHandlerStd
Standard error handler - logs to stdLogger
-
errorHandlerNoWarnings
public static final ErrorHandler errorHandlerNoWarnings
Error handler (no warnings) - logs to stdLogger
-
errorHandlerStrict
public static final ErrorHandler errorHandlerStrict
Strict error handler - logs to stdLogger - exceptions for warnings
-
errorHandlerWarn
public static final ErrorHandler errorHandlerWarn
Warning error handler - logs to stdLogger - messages for warnings and some errors
-
errorHandlerNoLogging
public static final ErrorHandler errorHandlerNoLogging
Silent error handler : ignores warnings, throws exceptions for errors
-
errorHandlerStrictNoLogging
public static final ErrorHandler errorHandlerStrictNoLogging
Silent, strict error handler
-
-
Method Detail
-
errorHandlerStrictSilent
public static ErrorHandler errorHandlerStrictSilent()
Silent, strict error handler, no logging
-
errorHandlerStrict
public static ErrorHandler errorHandlerStrict(org.slf4j.Logger log)
Strict error handler, with logging
-
errorHandlerStd
public static ErrorHandler errorHandlerStd(org.slf4j.Logger log)
An error handler that logs messages, then throws exceptions for errors but not warnings
-
errorHandlerIgnoreWarnings
public static ErrorHandler errorHandlerIgnoreWarnings(org.slf4j.Logger log)
An error handler that logs error and fatal messages, but not warnings
-
errorHandlerWarning
public static ErrorHandler errorHandlerWarning(org.slf4j.Logger log)
An error handler that logs messages for errors and warnings and attempts to carry on
-
errorHandlerSimple
public static ErrorHandler errorHandlerSimple()
Ignores warnings, throws exceptions for errors
-
errorHandlerTracking
public static ErrorHandlerFactory.ErrorHandlerTracking errorHandlerTracking(org.slf4j.Logger log, boolean failOnError, boolean failOnWarning)
Logs warnings and errors while tracking the counts of each and optionally throwing exceptions when errors and/or warnings are encounted
-
errorHandlerDetailed
@Deprecated public static ErrorHandler errorHandlerDetailed()
Deprecated.Use {#errorHandlerExceptionOnError}
-
errorHandlerExceptionOnError
public static ErrorHandler errorHandlerExceptionOnError()
An error handler that throws aRiotParseException
, hence it exposes the details of errors.
-
errorHandlerExceptions
public static ErrorHandler errorHandlerExceptions()
An error handler that throws exceptions in all cases.
-
errorHandlerWarnOrExceptions
public static ErrorHandler errorHandlerWarnOrExceptions(org.slf4j.Logger logger)
An error handler that logs warnings and throws exceptions on error and fatal.
-
getDefaultErrorHandler
public static ErrorHandler getDefaultErrorHandler()
Get the current default error handler
-
setDefaultErrorHandler
public static void setDefaultErrorHandler(ErrorHandler errorHandler)
Set the current default error handler - use carefully, mainly for use in testing
-
-