org.appng.api

## Interface ValidationProvider

- All Known Subinterfaces:
    Request
  All Known Implementing Classes:
    ApplicationRequest, DefaultValidationProvider

      public interface ValidationProvider

  Provides some validation-related methods.
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addValidationMetaData(MetaData metaData, ClassLoader classLoader, Class<?>... groups)` Based on the JSR-303 annotations of the `MetaData`'s bindclass, this method adds the `Validation` to the `FieldDef`initions.
    `void` | `validateBean(Object bean, FieldProcessor fieldProcessor, Class<?>... groups)` Validates the given bean by adding error-messages to the `FieldDef` initions, using `FieldProcessor.addErrorMessage(FieldDef, String)`.
    `void` | `validateBean(Object bean, FieldProcessor fieldProcessor, String[] excludeBindings, Class<?>... groups)` Validates the given bean by adding error-messages to the `FieldDef` initions, using `FieldProcessor.addErrorMessage(FieldDef, String)`.
    `void` | `validateField(Object bean, FieldProcessor fieldProcessor, String fieldBinding, Class<?>... groups)` Validates a single `FieldDef` by adding error-messages to it, using `FieldProcessor.addErrorMessage(FieldDef, String)`.

- - ### Method Detail

    - #### validateBean

          void validateBean(Object bean,
                            FieldProcessor fieldProcessor,
                            Class<?>... groups)

      Validates the given bean by adding error-messages to the `FieldDef` initions, using `FieldProcessor.addErrorMessage(FieldDef, String)`.
      Parameters:
        `bean` - the bean to validate
        `fieldProcessor` - the `FieldProcessor` containing the `MetaData` for the bean
        `groups` - the JSR-303 validation groups to use
      See Also:
        `FieldProcessor.addErrorMessage(FieldDef, String)`

    - #### validateBean

          void validateBean(Object bean,
                            FieldProcessor fieldProcessor,
                            String[] excludeBindings,
                            Class<?>... groups)

      Validates the given bean by adding error-messages to the `FieldDef` initions, using `FieldProcessor.addErrorMessage(FieldDef, String)`.
      Parameters:
        `bean` - the bean to validate
        `fieldProcessor` - the `FieldProcessor` containing the `MetaData` for the bean
        `excludeBindings` - an array of field-bindings to ignore during validation
        `groups` - the JSR-303 validation groups to use
      See Also:
        `FieldProcessor.addErrorMessage(FieldDef, String)`

    - #### validateField

          void validateField(Object bean,
                             FieldProcessor fieldProcessor,
                             String fieldBinding,
                             Class<?>... groups)

      Validates a single `FieldDef` by adding error-messages to it, using `FieldProcessor.addErrorMessage(FieldDef, String)`.
      Parameters:
        `bean` - the bean to validate
        `fieldProcessor` - the `FieldProcessor` containing the `MetaData` for the bean
        `fieldBinding` - the binding of the `FieldDef` to validate
        `groups` - the JSR-303 validation groups to use
      See Also:
        `FieldProcessor.addErrorMessage(FieldDef, String)`

    - #### addValidationMetaData

          void addValidationMetaData(MetaData metaData,
                                     ClassLoader classLoader,
                                     Class<?>... groups)
                              throws ClassNotFoundException

      Based on the JSR-303 annotations of the `MetaData`'s bindclass, this method adds the `Validation` to the `FieldDef`initions.
      Parameters:
        `metaData` - the `MetaData` to add the `Validation`s to
        `classLoader` - the `ClassLoader` to load the `MetaData`s bindClass
        `groups` - the JSR-303 validation groups to use
      Throws:
        `ClassNotFoundException` - if the bindClass can not be loaded
      See Also:
        `Min`, `Max`, `Size`, `Digits`, `NotNull`, `Future`, `Past`, `Type`, `Pattern`, `FileUpload`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.