public interface FieldConstraint
| Modifier and Type | Method and Description |
|---|---|
static FieldConstraint |
add(FieldConstraint a,
FieldConstraint b)
Merge two
FieldConstraints
values can be null |
<I extends Input> |
apply(boolean support_multi_stage,
java.lang.String field,
Selector<I> original,
Form form,
java.util.HashMap fixtures)
Mutate a
Selector based on other form fields. |
<I extends Input> Selector<I> apply(boolean support_multi_stage, java.lang.String field, Selector<I> original, Form form, java.util.HashMap fixtures)
Selector based on other form fields.
Normally this requires the value of the input to have a fixed value
e.g. an UnmodifiableInput, a ListInput with a single valid option or a suppressed field.
If the prerequisite fields are not fixed or not present then this method can return null
to request an additional form stage be introduced. The form builder should then retry this
field in subsequent stages (where previous fields will be locked). Fixed values are copied into the
fixtures map. This also can contain values for supressed fields. Care needs to be taken with pre-requisites that
are optional.
Ideally if support_multi_stage is false the method should add a corresponding FormValidator to the form instead and return
the original SelectorI - type of Inputsupport_multi_stage - Does surrounding context support multi-stagefield - Field that Selector is fororiginal - Selectorform - Form being built.fixtures - HashMap of fixed field data. This can include supressed fields. note values of optional fields may be null.Selector or null to request an additional form stage.static FieldConstraint add(FieldConstraint a, FieldConstraint b)
FieldConstraints
values can be nulla - b -