Package 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 java.lang.Object implements NameClassPairCallbackHandler
A NameClassPairCallbackHandler to collect all results in an internal List.- See Also:
LdapTemplate
-
-
Constructor Summary
Constructors Constructor Description CollectingNameClassPairCallbackHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<T>
getList()
Get the assembled list.abstract T
getObjectFromNameClassPair(javax.naming.NameClassPair nameClassPair)
Handle a NameClassPair and transform it to an Object of the desired type and with data from the NameClassPair.void
handleNameClassPair(javax.naming.NameClassPair nameClassPair)
Pass on the supplied NameClassPair togetObjectFromNameClassPair(NameClassPair)
and add the result to the internal list.
-
-
-
Method Detail
-
getList
public java.util.List<T> getList()
Get the assembled list.- Returns:
- the list of all assembled objects.
-
handleNameClassPair
public final void handleNameClassPair(javax.naming.NameClassPair nameClassPair) throws javax.naming.NamingException
Pass on the supplied NameClassPair togetObjectFromNameClassPair(NameClassPair)
and add the result to the internal list.- Specified by:
handleNameClassPair
in interfaceNameClassPairCallbackHandler
- Parameters:
nameClassPair
- the NameClassPair returned from theNamingEnumeration
.- Throws:
javax.naming.NamingException
- if an error occurs.
-
getObjectFromNameClassPair
public abstract T getObjectFromNameClassPair(javax.naming.NameClassPair nameClassPair) throws javax.naming.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:
javax.naming.NamingException
- if an error occurs.
-
-