org.appng.api

## Interface FieldProcessor

- All Known Implementing Classes:
    FieldProcessorImpl

      public interface FieldProcessor

  A `FieldProcessor` keeps track of the `MetaData` and `Linkpanel`s defined in the `DataConfig` of a `Datasource`. It provides several methods to add `Message`s, which can be field-specific.
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addErrorMessage(FieldDef field, String message)` Adds a `Message` of type `MessageType.ERROR` to the given field.
    `void` | `addErrorMessage(String message)` Adds a `Message` of type `MessageType.ERROR`.
    `void` | `addInvalidMessage(FieldDef field, String message)` Adds a `Message` of type `MessageType.INVALID` to the given field.
    `void` | `addInvalidMessage(String message)` Adds a `Message` of type `MessageType.INVALID`.
    `void` | `addLinkPanels(List<Linkpanel> panels)` Adds the given list of `Linkpanel`s to this `FieldProcessor`
    `void` | `addNoticeMessage(FieldDef field, String message)` Adds a `Message` of type `MessageType.NOTICE` to the given field.
    `void` | `addNoticeMessage(String message)` Adds a `Message` of type `MessageType.INVALID`.
    `void` | `addOkMessage(FieldDef field, String message)` Adds a `Message` of type `MessageType.OK` to the given field.
    `void` | `addOkMessage(String message)` Adds a `Message` of type `MessageType.OK`.
    `void` | `clearFieldMessages()` Clears all `Message`s which were previously added using `addXXMessage(FieldDef field, String message)`.
    `void` | `clearFieldMessages(String... fieldBindings)` Clears all `Message`s for the `FieldDef`initions with the given bindings.
    `void` | `clearMessages()` Clears all `Message`s which were previously added using `addXXMessage(String message)`.
    `FieldDef` | `getField(String fieldBinding)` Returns the `FieldDef` with the given binding, if existing.
    `List<FieldDef>` | `getFields()` Returns all `FieldDef`intions known by this `FieldProcessor`.
    `Linkpanel` | `getLinkPanel(String fieldName)` Returns the `Linkpanel` with the given name, if existing.
    `Messages` | `getMessages()` Returns a new `Messages`-object containing all `Message`s previously added using `addXXMessage(String message)`.
    `MetaData` | `getMetaData()` Returns the `MetaData` of this `FieldProcessor`.
    `org.springframework.data.domain.Pageable` | `getPageable()` Returns the `Pageable` for this `FieldProcessor`.
    `String` | `getReference()` Returns the id of the `Action` or `Datasource` this `FieldProcessor` was created for.
    `boolean` | `hasErrors()` Checks whether this `FieldProcessor` or one of its fields has a `Message` of type `MessageType.ERROR`.
    `boolean` | `hasField(String fieldBinding)` Checks whether a `FieldDef` with the given binding exists for this `FieldProcessor`.
    `boolean` | `hasFieldErrors()` Checks whether one of the fields has a `Message` of type `MessageType.ERROR`.

- - ### Method Detail

    - #### getFields

          List<FieldDef> getFields()

      Returns all `FieldDef`intions known by this `FieldProcessor`.
      Returns:
        a `List` of `FieldDef`intions

    - #### getField

          FieldDef getField(String fieldBinding)

      Returns the `FieldDef` with the given binding, if existing.
      Parameters:
        `fieldBinding` - the binding of the `FieldDef` to return
      Returns:
        the `FieldDef` with the given binding, or `null` if no such `FieldDef` exists
      See Also:
        `FieldDef.getBinding()`

    - #### getMetaData

          MetaData getMetaData()

      Returns the `MetaData` of this `FieldProcessor`.
      Returns:
        the `MetaData`

    - #### hasField

          boolean hasField(String fieldBinding)

      Checks whether a `FieldDef` with the given binding exists for this `FieldProcessor`.
      Parameters:
        `fieldBinding` - the binding of the `FieldDef` to check
      Returns:
        `true` if such a `FieldDef` exists, `false` otherwise.
      See Also:
        `getField(String)`

    - #### getReference

          String getReference()

      Returns the id of the `Action` or `Datasource` this `FieldProcessor` was created for.
      Returns:
        the reference id

    - #### hasErrors

          boolean hasErrors()

      Checks whether this `FieldProcessor` or one of its fields has a `Message` of type `MessageType.ERROR`.
      Returns:
        `true` if there are any `Message`s of `MessageType.ERROR`, `false` otherwise
      See Also:
        `addErrorMessage(String)`, `addErrorMessage(FieldDef, String)`

    - #### hasFieldErrors

          boolean hasFieldErrors()

      Checks whether one of the fields has a `Message` of type `MessageType.ERROR`.
      Returns:
        `true` if any of the `FieldProcessor`s `FieldDef`s has a `Message` of type `MessageType.ERROR`, `false` otherwise
      See Also:
        `addErrorMessage(FieldDef, String)`

    - #### addOkMessage

          void addOkMessage(String message)

      Adds a `Message` of type `MessageType.OK`.
      Parameters:
        `message` - the message to add

    - #### addLinkPanels

          void addLinkPanels(List<Linkpanel> panels)

      Adds the given list of `Linkpanel`s to this `FieldProcessor`
      Parameters:
        `panels` - a list of `Linkpanel`s

    - #### getLinkPanel

          Linkpanel getLinkPanel(String fieldName)

      Returns the `Linkpanel` with the given name, if existing.
      Parameters:
        `fieldName` - the name of the `FieldDef` respectively the `Linkpanel`
      Returns:
        the `Linkpanel`, if existing, `null` otherwise

    - #### addOkMessage

          void addOkMessage(FieldDef field,
                            String message)

      Adds a `Message` of type `MessageType.OK` to the given field.
      Parameters:
        `field` - the `FieldDef` to add the `Message` to
        `message` - the message to add

    - #### addErrorMessage

          void addErrorMessage(String message)

      Adds a `Message` of type `MessageType.ERROR`.
      Parameters:
        `message` - the message to add
      See Also:
        `hasErrors()`

    - #### addErrorMessage

          void addErrorMessage(FieldDef field,
                               String message)

      Adds a `Message` of type `MessageType.ERROR` to the given field.
      Parameters:
        `field` - the `FieldDef` to add the `Message` to
        `message` - the message to add
      See Also:
        `hasErrors()`, `hasFieldErrors()`

    - #### addInvalidMessage

          void addInvalidMessage(String message)

      Adds a `Message` of type `MessageType.INVALID`.
      Parameters:
        `message` - the message to add

    - #### addInvalidMessage

          void addInvalidMessage(FieldDef field,
                                 String message)

      Adds a `Message` of type `MessageType.INVALID` to the given field.
      Parameters:
        `field` - the `FieldDef` to add the `Message` to
        `message` - the message to add

    - #### addNoticeMessage

          void addNoticeMessage(String message)

      Adds a `Message` of type `MessageType.INVALID`.
      Parameters:
        `message` - the message to add

    - #### addNoticeMessage

          void addNoticeMessage(FieldDef field,
                                String message)

      Adds a `Message` of type `MessageType.NOTICE` to the given field.
      Parameters:
        `field` - the `FieldDef` to add the `Message` to
        `message` - the message to add

    - #### getMessages

          Messages getMessages()

      Returns a new `Messages`-object containing all `Message`s previously added using `addXXMessage(String message)`.
      Returns:
        a new `Messages` instance containing the previously added `Message`s
      See Also:
        `addOkMessage(String)`, `addNoticeMessage(String)`, `addInvalidMessage(String)`, `addErrorMessage(String)`

    - #### clearMessages

          void clearMessages()

      Clears all `Message`s which were previously added using `addXXMessage(String message)`.
      See Also:
        `addOkMessage(String)`, `addNoticeMessage(String)`, `addInvalidMessage(String)`, `addErrorMessage(String)`

    - #### clearFieldMessages

          void clearFieldMessages()

      Clears all `Message`s which were previously added using `addXXMessage(FieldDef field, String message)`.
      See Also:
        `addOkMessage(FieldDef, String)`, `addNoticeMessage(FieldDef, String)`, `addInvalidMessage(FieldDef, String)`, `addErrorMessage(FieldDef, String)`

    - #### clearFieldMessages

          void clearFieldMessages(String... fieldBindings)

      Clears all `Message`s for the `FieldDef`initions with the given bindings.
      Parameters:
        `fieldBindings` - the bindings of the fields to clear the messages for
      See Also:
        `addOkMessage(FieldDef, String)`, `addNoticeMessage(FieldDef, String)`, `addInvalidMessage(FieldDef, String)`, `addErrorMessage(FieldDef, String)`, `FieldDef.getBinding()`

    - #### getPageable

          org.springframework.data.domain.Pageable getPageable()

      Returns the `Pageable` for this `FieldProcessor`.
      Returns:
        the `Pageable`

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