Package 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 eachBinding
, and then passed to the specified ContextMapper for translation.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description ContextMapperCallbackHandler(ContextMapper<T> mapper)
Constructs a new instance wrapping the suppliedContextMapper
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getObjectFromNameClassPair(javax.naming.NameClassPair nameClassPair)
Cast the NameClassPair to aBinding
and pass its object to the ContextMapper.-
Methods inherited from class org.springframework.ldap.core.CollectingNameClassPairCallbackHandler
getList, handleNameClassPair
-
-
-
-
Constructor Detail
-
ContextMapperCallbackHandler
public ContextMapperCallbackHandler(ContextMapper<T> mapper)
Constructs a new instance wrapping the suppliedContextMapper
.- Parameters:
mapper
- the mapper to be called for each entry.
-
-
Method Detail
-
getObjectFromNameClassPair
public T getObjectFromNameClassPair(javax.naming.NameClassPair nameClassPair) throws javax.naming.NamingException
Cast the NameClassPair to aBinding
and pass its object to the ContextMapper.- Specified by:
getObjectFromNameClassPair
in classCollectingNameClassPairCallbackHandler<T>
- Parameters:
nameClassPair
- a Binding instance.- Returns:
- the Object returned from the mapper.
- Throws:
javax.naming.NamingException
- if an error occurs.ObjectRetrievalException
- if the object of the nameClassPair is null.
-
-