Interface SchemaErrorHandler
-
- All Known Implementing Classes:
LoggingSchemaErrorHandler
public interface SchemaErrorHandler
Interface for handling errors that occur during schema processing.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Throwable>
getErrors()
Returns list of handled errors.void
handle(org.slf4j.Logger log, String message, Throwable exception)
Handle schema error.void
reset()
Resets implementation state.boolean
wasError()
Returns true if the implementation handled at least one error.
-
-
-
Method Detail
-
handle
void handle(org.slf4j.Logger log, String message, Throwable exception)
Handle schema error. Implementation is free to log the error, ignore the error or do anything else. If the error is not ignored then implementation should remember the error and reflect that in its state. Other methods of this interface should behave in accord with that state.- Parameters:
log
- Logger that could be used to record error messages.message
- Error message.exception
- Exception (if available). Exception may provide more structured description of the error. But it may not be available for all error states. However, only those invocations of handle() method that contain an exceptions are considered to be errors. The implementation may ignore any invocations that do not contain exception.
-
wasError
boolean wasError()
Returns true if the implementation handled at least one error. This method is used for checks whether the schema processing should proceed or stop, e.g. in cases when we want to stop processing on errors.- Returns:
- true if at least one error was met
-
getErrors
List<Throwable> getErrors()
Returns list of handled errors.- Returns:
- The list of found errors
-
reset
void reset()
Resets implementation state. This cleans up any recorded errors.
-
-