Interface CompositeComponentHandler<T,​S>

  • Type Parameters:
    T - the data type of this ComponentHandler
    S - the data type of the child handlers
    All Superinterfaces:
    ComponentHandler<T>
    All Known Implementing Classes:
    AbstractCompositeComponentHandler, AbstractRadioButtonHandler, DefaultRadioButtonHandler

    public interface CompositeComponentHandler<T,​S>
    extends ComponentHandler<T>

    Definition of an interface for complex component handlers that can contain other component handlers.

    The form builder library supports component handlers that can combine other handlers and let them appear as a single component. This can be useful e.g. for radio buttons: Instead of storing the state of each button in the form's data bean, a composite handler can be defined, which encapsulates the buttons in the radio group and transforms their states into a number, describing the index of the selected radio button.

    There are some tag handler classes in the form builder tag library that support the creation of such composite handler instances (and their association with an input component). These tags make use of this interface to add simple component handlers to the composite one.

    Version:
    $Id: CompositeComponentHandler.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Detail

      • addHandler

        void addHandler​(String name,
                        ComponentHandler<S> handler)
        Adds a simple ComponentHandler object to this composite handler.
        Parameters:
        name - the name of the corresponding component
        handler - the handler to add