You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking that maybe we could introduce TryReadxxx() methods on the reader implementations which do not throw exceptions, rather they may return null/an empty list maybe along with a list of strings for the caller to inspect and react upon. In C# "out parameters" are typically used with TryXXX methods. I'm not sure what to use in Java. Especially if we want to keep compatibility with java 1.5
something like
public boolean TryRead(T bean, string[] nameMapping, List rawLineData)
What are your thoughts? @jamesbassett your thoughts?
The text was updated successfully, but these errors were encountered:
I think, that if we want to implement something like this we should return much more than only "boolean" or "null/empty" value. User probably would like to see complex POJO class with list of columns for which parsing has failed with error messages and all additional data which we can provide.
Yes that might be a good idea. Originally, when I thought of this I was just thinking about the "standard" try-pattern with a method object Read() throws ... and a bool TryRead(out result) - but since Java does not have the possibility of returning multiple values natively, we need to wrap the result in some resulttuple or something, so we might at well cater for the need of providing more information now that we've gone through the trouble of trying to read.
I was thinking that maybe we could introduce TryReadxxx() methods on the reader implementations which do not throw exceptions, rather they may return null/an empty list maybe along with a list of strings for the caller to inspect and react upon. In C# "out parameters" are typically used with TryXXX methods. I'm not sure what to use in Java. Especially if we want to keep compatibility with java 1.5
something like
public boolean TryRead(T bean, string[] nameMapping, List rawLineData)
What are your thoughts? @jamesbassett your thoughts?
The text was updated successfully, but these errors were encountered: