Package com.helger.xml.sax
Class CollectingSAXErrorHandler
- java.lang.Object
-
- com.helger.xml.sax.AbstractSAXErrorHandler
-
- com.helger.xml.sax.CollectingSAXErrorHandler
-
- All Implemented Interfaces:
ISAXErrorHandler,Serializable,ErrorHandler
- Direct Known Subclasses:
WrappedCollectingSAXErrorHandler
@ThreadSafe public class CollectingSAXErrorHandler extends AbstractSAXErrorHandler
An error handler implementation that stores all warnings, errors and fatal errors.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description CollectingSAXErrorHandler()protectedCollectingSAXErrorHandler(Supplier<com.helger.commons.error.list.ErrorList> aErrorListProvider)Protected constructor to use a differentErrorList- e.g. for existing error lists.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.commons.state.EChangeclearResourceErrors()Clear all currently stored errors.booleancontainsAtLeastOneError()com.helger.commons.error.list.IErrorListgetErrorList()protected voidinternalLog(com.helger.commons.error.level.IErrorLevel aErrorLevel, SAXParseException aException)StringtoString()-
Methods inherited from class com.helger.xml.sax.AbstractSAXErrorHandler
error, fatalError, getSaxParseError, warning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.xml.sax.ISAXErrorHandler
andThen
-
-
-
-
Constructor Detail
-
CollectingSAXErrorHandler
public CollectingSAXErrorHandler()
-
CollectingSAXErrorHandler
protected CollectingSAXErrorHandler(@Nonnull Supplier<com.helger.commons.error.list.ErrorList> aErrorListProvider)
Protected constructor to use a differentErrorList- e.g. for existing error lists.- Parameters:
aErrorListProvider- The error list provider. May not benull.- Since:
- 9.2.0
-
-
Method Detail
-
internalLog
protected void internalLog(@Nonnull com.helger.commons.error.level.IErrorLevel aErrorLevel, SAXParseException aException)
- Specified by:
internalLogin classAbstractSAXErrorHandler
-
getErrorList
@Nonnull @ReturnsMutableCopy public com.helger.commons.error.list.IErrorList getErrorList()
-
containsAtLeastOneError
public boolean containsAtLeastOneError()
-
clearResourceErrors
@Nonnull public com.helger.commons.state.EChange clearResourceErrors()
Clear all currently stored errors.- Returns:
EChange.CHANGEDif at least one item was cleared.
-
toString
public String toString()
- Overrides:
toStringin classAbstractSAXErrorHandler
-
-