Spring LDAP

org.springframework.ldap.core
Class AttributesMapperCallbackHandler<T>

java.lang.Object
  extended by org.springframework.ldap.core.CollectingNameClassPairCallbackHandler<T>
      extended by org.springframework.ldap.core.AttributesMapperCallbackHandler<T>
All Implemented Interfaces:
NameClassPairCallbackHandler

public class AttributesMapperCallbackHandler<T>
extends CollectingNameClassPairCallbackHandler<T>

A CollectingNameClassPairCallbackHandler to wrap an AttributesMapper. That is, the found object is extracted from the Attributes of each SearchResult, and then passed to the specified AttributesMapper for translation.

Since:
1.2
Author:
Mattias Hellborg Arthursson, Ulrik Sandberg

Constructor Summary
AttributesMapperCallbackHandler(AttributesMapper<T> mapper)
          Constructs a new instance around the specified AttributesMapper.
 
Method Summary
 T getObjectFromNameClassPair(NameClassPair nameClassPair)
          Cast the NameClassPair to a SearchResult and pass its attributes to the AttributesMapper.
 
Methods inherited from class org.springframework.ldap.core.CollectingNameClassPairCallbackHandler
getList, handleNameClassPair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesMapperCallbackHandler

public AttributesMapperCallbackHandler(AttributesMapper<T> mapper)
Constructs a new instance around the specified AttributesMapper.

Parameters:
mapper - the target mapper.
Method Detail

getObjectFromNameClassPair

public T getObjectFromNameClassPair(NameClassPair nameClassPair)
Cast the NameClassPair to a SearchResult and pass its attributes to the AttributesMapper.

Specified by:
getObjectFromNameClassPair in class CollectingNameClassPairCallbackHandler<T>
Parameters:
nameClassPair - a SearchResult instance.
Returns:
the Object returned from the mapper.

Spring LDAP