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 classErrorHandlerFactory.ErrorHandlerTrackingAn error handler that logs message for errors and warnings and throw exceptions on either
-
Field Summary
Fields Modifier and Type Field Description static ErrorHandlererrorHandlerNoLoggingSilent error handler : ignores warnings, throws exceptions for errorsstatic ErrorHandlererrorHandlerNoWarningsError handler (no warnings) - logs to stdLoggerstatic ErrorHandlererrorHandlerStdStandard error handler - logs to stdLoggerstatic ErrorHandlererrorHandlerStrictStrict error handler - logs to stdLogger - exceptions for warningsstatic ErrorHandlererrorHandlerStrictNoLoggingSilent, strict error handlerstatic ErrorHandlererrorHandlerWarnWarning error handler - logs to stdLogger - messages for warnings and some errorsstatic org.slf4j.LoggernoLoggerstatic org.slf4j.LoggerstdLogger
-
Constructor Summary
Constructors Constructor Description ErrorHandlerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ErrorHandlererrorHandlerDetailed()An error handler that throws aRiotParseException, hence it exposes the details of errors.static ErrorHandlererrorHandlerExceptions()An error handler that throws exceptions in all cases.static ErrorHandlererrorHandlerNoWarnings(org.slf4j.Logger log)An error handler that logs error and fatal messages, but not warningsstatic ErrorHandlererrorHandlerSimple()Ignores warnings, throws exceptions for errorsstatic ErrorHandlererrorHandlerStd(org.slf4j.Logger log)An error handler that logs messages, then throws exceptions for errors but not warningsstatic ErrorHandlererrorHandlerStrict(org.slf4j.Logger log)Strict error handler, with loggingstatic ErrorHandlererrorHandlerStrictSilent()Silent, strict error handler, no loggingstatic ErrorHandlerFactory.ErrorHandlerTrackingerrorHandlerTracking(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 ErrorHandlererrorHandlerWarning(org.slf4j.Logger log)An error handler that logs messages for errors and warnings and attempts to carry onstatic ErrorHandlergetDefaultErrorHandler()Get the current default error handlerstatic voidsetDefaultErrorHandler(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
-
errorHandlerNoWarnings
public static ErrorHandler errorHandlerNoWarnings(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
public static ErrorHandler errorHandlerDetailed()
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.
-
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
-
-