Re: Bindings as annotation?

From: Anjo Krank (anj..rank.net)
Date: Thu Jul 24 2008 - 07:05:04 EDT

  • Next message: JIRA: "[OS-JIRA] Created: (WOL-870) Allow command-line use of the component (*.wo/) formatter."

    Am 24.07.2008 um 12:01 schrieb Q:

    > Looks interesting, but how would you write something like this one?

    > <validation message="Either items, nameKey and valueKey or dataset
    > must be bound">

    Well... you are pretty free in creating your own parser, but this
    probably would be:

       condition = "(items=SET OR nameKey=UNSET) or (items=UNSET OR
    nameKey=SET)", fail="if name is set then valuekey must also be set"
       condition = "(dataset=SET OR valueKey =UNSET) or (dataset=UNSET OR
    valueKey=SET)", fail="if name is set then valuekey must also be set"
       condition = "(items=SET OR nameKey=SET) and (dataset=SET OR
    valueKey=SET)", fail="if name or items is set"

    but you could probably also do:

       condition = "(allBound(items,nameKey) and
    anyBound(dataset,valueKey)) or (anyBound(items,nameKey) and
    allBound(dataset,valueKey))" fail="..."

    which to me looks a bit easier to read - and would actually be what
    the message say (at least I think so).

    Cheers, Anjo



    This archive was generated by hypermail 2.0.0 : Thu Jul 24 2008 - 07:05:53 EDT