Menu

How can I create dependencies between CellProcessor-based column constraints?

Help
Ronan
2013-04-02
2013-04-03
  • Ronan

    Ronan - 2013-04-02

    Hi.

    Consider a SuperCSV import with these processors:

    • Column A is constrained to "Yes" or "No" via IsIncludedIn()
    • Column B is made mandatory via NotNull()

    That works well, but is it possible to say that Column B is mandatory only if Column A is equal to "No"? Chaining (multiple constraints on a single column) is not what I want to do, what I want is a constraint that takes multiple columns as its input. Is that possible?

    Thanks for your work! Great library, very clean and well-documented :)

     
  • James Bassett

    James Bassett - 2013-04-03

    Hi Ronan,

    Cross-validation (involving multiple columns) isn't supported, but it should be possible to achieve it by writing some custom cell processors. See this for an example. If you see a better solution let me know!

     
  • Ronan

    Ronan - 2013-04-03

    Having a look at these examples. Thanks for the fast answer!