Interface JAXXValidator


  • public interface JAXXValidator
    The contract of a validator-able object.
    Author:
    Tony Chemit - dev@tchemit.fr
    • Field Detail

      • log

        static final org.apache.logging.log4j.Logger log
    • Method Detail

      • getValidator

        SwingValidator<?> getValidator​(String validatorId)
        Obtain a validator from his id
        Parameters:
        validatorId - validator id
        Returns:
        the associated validator, or null if not find
      • getValidatorIds

        List<String> getValidatorIds()
        Returns:
        the list of ids of all registered validator
      • 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
      • listenValidatorContextNameAndRefreshFields

        default void listenValidatorContextNameAndRefreshFields​(SwingValidator<?> validator)
      • installValidationUI

        default void installValidationUI()
        To install all the stuff for validation on a JAXXValidator ui.

        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_setProperties method.

      • 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 property
        excludeIds - the list of validator id to exclude