org.springframework.ldap.core
Class ContextMapperCallbackHandler<T>
java.lang.Object
org.springframework.ldap.core.CollectingNameClassPairCallbackHandler<T>
org.springframework.ldap.core.ContextMapperCallbackHandler<T>
- All Implemented Interfaces:
- NameClassPairCallbackHandler
- Direct Known Subclasses:
- ContextMapperCallbackHandlerWithControls, ContextMapperCallbackHandlerWithControls
public class ContextMapperCallbackHandler<T>
- extends CollectingNameClassPairCallbackHandler<T>
A CollectingNameClassPairCallbackHandler to wrap a ContextMapper. That is,
the found object is extracted from each Binding
, and then passed to
the specified ContextMapper for translation.
- Since:
- 1.2
- Author:
- Mattias Hellborg Arthursson, Ulrik Sandberg
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContextMapperCallbackHandler
public ContextMapperCallbackHandler(ContextMapper<T> mapper)
- Constructs a new instance wrapping the supplied
ContextMapper
.
- Parameters:
mapper
- the mapper to be called for each entry.
getObjectFromNameClassPair
public T getObjectFromNameClassPair(NameClassPair nameClassPair)
throws NamingException
- Cast the NameClassPair to a
Binding
and pass its object to
the ContextMapper.
- Specified by:
getObjectFromNameClassPair
in class CollectingNameClassPairCallbackHandler<T>
- Parameters:
nameClassPair
- a Binding instance.
- Returns:
- the Object returned from the mapper.
- Throws:
NamingException
- if an error occurs.
ObjectRetrievalException
- if the object of the nameClassPair is null.