org.granite.client.validation.javafx
Class FormValidator
java.lang.Object
org.granite.client.validation.javafx.FormValidator
public class FormValidator
- extends Object
- Author:
- William DRAI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNHANDLED_VIOLATIONS
public static final String UNHANDLED_VIOLATIONS
- See Also:
- Constant Field Values
form
protected javafx.scene.Parent form
inputs
protected List<javafx.scene.Node> inputs
inputProperties
protected Map<javafx.scene.Node,javafx.beans.property.Property<?>> inputProperties
entityProperties
protected Map<javafx.scene.Node,javafx.beans.property.Property<?>> entityProperties
focusedOutOnce
protected Set<javafx.scene.Node> focusedOutOnce
violations
protected List<ConstraintViolation<?>> violations
unhandledViolations
protected javafx.collections.ObservableList<ConstraintViolation<?>> unhandledViolations
validateOnChangeProperty
public javafx.beans.property.BooleanProperty validateOnChangeProperty
- Should validation be done on the fly? Otherwise, validation will be
only done when an input loses focus. Default is true.
groups
public Class<?>[] groups
- The validation groups to be used, as an array of
Class
names. Default is null, meaning that the Default group
will be used.
FormValidator
public FormValidator()
FormValidator
public FormValidator(TraversableResolver traversableResolver)
FormValidator
public FormValidator(ValidatorFactory validatorFactory)
isValidateOnChange
public boolean isValidateOnChange()
setValidateOnChange
public void setValidateOnChange(boolean validateOnChange)
validate
public boolean validate(javafx.event.EventTarget entity)
getForm
public javafx.scene.Parent getForm()
- The form component that contains inputs bound to the entity properties
(may be a
Form or any other Container
subclass).
setForm
public void setForm(javafx.scene.Parent form)
getViolations
public List<ConstraintViolation<?>> getViolations()
- Returns the result of the last global validation as an array of
ConstraintViolations.
- Returns:
- the result of the last global validation as an array of
ConstraintViolations.
getUnhandledViolations
public List<ConstraintViolation<?>> getUnhandledViolations()
- Returns the unhandled violations of the last global validation
as an array of
ConstraintViolations. Unhandled violations
are violations that couldn't be associated to any input during the
last global validation (thus, they couldn't be displayed anywhere).
- Returns:
- the unhandled violations of the last global validation
as an array of
ConstraintViolations.
setupForm
protected void setupForm(javafx.scene.Parent form)
trackNode
protected void trackNode(javafx.scene.Node node)
untrackNode
protected void untrackNode(javafx.scene.Node node)
validateValue
protected boolean validateValue(javafx.scene.Node input,
boolean focusOut)
handleViolations
protected void handleViolations(javafx.scene.Node input,
Set<ConstraintViolation<Object>> violations)