Interface JAXXValidator
-
public interface JAXXValidatorThe contract of a validator-able object.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.logging.log4j.Loggerlog
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description com.google.common.collect.ArrayListMultimap<JComponent,ValidatorField>createValidatorEditors()SwingValidator<?>getValidator(String validatorId)Obtain a validator from his idcom.google.common.collect.ArrayListMultimap<JComponent,ValidatorField>getValidatorEditors()List<String>getValidatorIds()default voidinstallTabUI(TabInfoWithValidator tab)default voidinstallValidationUI()To install all the stuff for validation on aJAXXValidatorui.default voidlistenValidatorContextNameAndRefreshFields(SwingValidator<?> validator)default voidregisterValidatorFields()Init the fields representation.default voidsetFieldRepresentation(com.google.common.collect.Multimap<JComponent,ValidatorField> editors)Each field found will be registered to his corresponding validator via the methodSwingValidator.setFieldRepresentation(String, JComponent).default voidsetValidatorBean(Object bean, String... excludeIds)method to attach a bean to all validators of an JAXXObject.default voidsetValidatorChanged(boolean newValue, String... excludeIds)method to set the changed property to all validators of an JAXXObject.default voiduninstallTabUI(Collection<TabInfoWithValidator> tabEditors, SwingValidatorMessageTableModel errorTableModel)default Stream<SwingValidator<?>>validatorsStream(Predicate<String> idPredicate)
-
-
-
Method Detail
-
getValidator
SwingValidator<?> getValidator(String validatorId)
Obtain a validator from his id- Parameters:
validatorId- validator id- Returns:
- the associated validator, or
nullif not find
-
getValidatorEditors
com.google.common.collect.ArrayListMultimap<JComponent,ValidatorField> getValidatorEditors()
-
createValidatorEditors
com.google.common.collect.ArrayListMultimap<JComponent,ValidatorField> createValidatorEditors()
-
registerValidatorFields
default void registerValidatorFields()
Init the fields representation.This method is generated and should be called each time the context name of a validator has changed, since when using method
SwingValidator.setFieldRepresentation(String, JComponent)is invoked at init, if a field is not watched for the selected context, then after when changing context name, the field will not be notified of any changed...- Since:
- 2.2.1
-
validatorsStream
default Stream<SwingValidator<?>> validatorsStream(Predicate<String> idPredicate)
-
listenValidatorContextNameAndRefreshFields
default void listenValidatorContextNameAndRefreshFields(SwingValidator<?> validator)
-
setFieldRepresentation
default void setFieldRepresentation(com.google.common.collect.Multimap<JComponent,ValidatorField> editors)
Each field found will be registered to his corresponding validator via the methodSwingValidator.setFieldRepresentation(String, JComponent).By default, this method is invoked in the generated method
registerValidatorFields()by a generated jaxx-validator file.- Parameters:
editors- mapping to register
-
installValidationUI
default void installValidationUI()
To install all the stuff for validation on aJAXXValidatorui.It will first find and register all validator field via the method
registerValidatorFields(), then for each validators it will install ui for it (says connect validator to ui via layers) and will reload attached bean to make visible bean validation state on ui.This method is always invoked by a generated jaxx-validator file at the end of the
$initialize_05_setPropertiesmethod.
-
setValidatorBean
default void setValidatorBean(Object bean, String... excludeIds)
method to attach a bean to all validators of an JAXXObject.It is possible to exclude some validator to be treated.
- Parameters:
bean- the bean to attach in validators (can be null)excludeIds- the list of validator id to exclude
-
setValidatorChanged
default void setValidatorChanged(boolean newValue, String... excludeIds)method to set the changed property to all validators of an JAXXObject.It is possible to exclude some validator to be treated.
- Parameters:
newValue- the new value to set in changed validator propertyexcludeIds- the list of validator id to exclude
-
installTabUI
default void installTabUI(TabInfoWithValidator tab)
-
uninstallTabUI
default void uninstallTabUI(Collection<TabInfoWithValidator> tabEditors, SwingValidatorMessageTableModel errorTableModel)
-
-