Details
-
Type: New Feature
-
Status: Closed
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
XStream currently follows the fail fast fail early paradigm.
It would be very handy to be able to customise this. For example, lets say an end user edited a configuration file, and messed up a small amount of code.
It would be nice to have an interface that suggested to xstream it should force ahead.
For example, an interface could be added:
public interface IStreamErrorHandler
{ public boolean isFatal(StreamException e, ...); }
The above was incomplete when submitted.
public interface IXtreamError
{ public StreamException getStreamException(); public String getField(); public String getParent(); }public interface IStreamErrorHandler
{ public boolean isFatal(IXStreamError streamError public void addError(IXStreamError error); public IXStreamError[] getErrors(); }The default handler could provide the basic default handling, but the custom handler could simply forge on ahead while accumulating errors.
Take for example the option of xstream being used to pass AVALON input scripts (which would emit java code first -> see last feature request). The user edits a file, but there is an error - he wants to see all of the errors, but try to forge ahead anyway. Like the concept of ill-formed html.