public class MultiFieldConstraint extends java.util.LinkedHashSet<FieldConstraint> implements FieldConstraint
FieldConstraint. The constaints are added in order![]() |
![]() |
| Constructor and Description |
|---|
MultiFieldConstraint(FieldConstraint... constraints) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(FieldConstraint e) |
<I extends Input> |
apply(boolean support_multi_stage,
java.lang.String field,
Selector<I> sel,
Form form,
java.util.HashMap fixtures)
Mutate a
Selector based on other form fields. |
clear, clone, contains, isEmpty, iterator, remove, sizeaddAll, containsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddpublic MultiFieldConstraint(FieldConstraint... constraints)
public boolean add(FieldConstraint e)
add in interface java.util.Collection<FieldConstraint>add in interface java.util.Set<FieldConstraint>add in class java.util.HashSet<FieldConstraint>public <I extends Input> Selector<I> apply(boolean support_multi_stage, java.lang.String field, Selector<I> sel, Form form, java.util.HashMap fixtures)
FieldConstraintSelector 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 Selectorapply in interface FieldConstraintI - type of Inputsupport_multi_stage - Does surrounding context support multi-stagefield - Field that Selector is forsel - 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.