org.springframework.ldap.core

## Class CollectingNameClassPairCallbackHandler<T>

- java.lang.Object
- - org.springframework.ldap.core.CollectingNameClassPairCallbackHandler<T>

- All Implemented Interfaces:
    NameClassPairCallbackHandler
  Direct Known Subclasses:
    AttributesMapperCallbackHandler, ContextMapperCallbackHandler, LdapTemplate.MappingCollectingNameClassPairCallbackHandler

      public abstract class CollectingNameClassPairCallbackHandler<T>
      extends Object
      implements NameClassPairCallbackHandler

  A NameClassPairCallbackHandler to collect all results in an internal List.
  Author:
    Mattias Hellborg Arthursson
  See Also:
    `LdapTemplate`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectingNameClassPairCallbackHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<T>` | `getList()` Get the assembled list.
    `abstract T` | `getObjectFromNameClassPair(NameClassPair nameClassPair)` Handle a NameClassPair and transform it to an Object of the desired type and with data from the NameClassPair.
    `void` | `handleNameClassPair(NameClassPair nameClassPair)` Pass on the supplied NameClassPair to `getObjectFromNameClassPair(NameClassPair)` and add the result to the internal list.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CollectingNameClassPairCallbackHandler

          public CollectingNameClassPairCallbackHandler()

  - ### Method Detail

    - #### getList

          public List<T> getList()

      Get the assembled list.
      Returns:
        the list of all assembled objects.

    - #### handleNameClassPair

          public final void handleNameClassPair(NameClassPair nameClassPair)
                                         throws NamingException

      Pass on the supplied NameClassPair to `getObjectFromNameClassPair(NameClassPair)` and add the result to the internal list.
      Specified by:
        `handleNameClassPair` in interface `NameClassPairCallbackHandler`
      Parameters:
        `nameClassPair` - the NameClassPair returned from the `NamingEnumeration`.
      Throws:
        `NamingException` - if an error occurs.

    - #### getObjectFromNameClassPair

          public abstract T getObjectFromNameClassPair(NameClassPair nameClassPair)
                                                throws NamingException

      Handle a NameClassPair and transform it to an Object of the desired type and with data from the NameClassPair.
      Parameters:
        `nameClassPair` - a NameClassPair from a search operation.
      Returns:
        an object constructed from the data in the NameClassPair.
      Throws:
        `NamingException` - if an error occurs.