Package org.springframework.ldap.core
Interface ContextMapper<T>
-
- All Known Subinterfaces:
ContextAssembler
,ContextMapperWithControls<T>
,ParameterizedContextMapper<T>
,ParameterizedContextMapperWithControls<T>
- All Known Implementing Classes:
AbstractContextMapper
,AbstractParameterizedContextMapper
,AttributeCheckContextMapper
,LdapEntryIdentificationContextMapper
public interface ContextMapper<T>
An interface used by LdapTemplate to map LDAP Contexts to beans. When a DirObjectFactory is set on the ContextSource, the objects returned fromsearch
andlistBindings
operations are automatically transformed to DirContext objects (when using theDefaultDirObjectFactory
- which is typically the case, unless something else has been explicitly specified - you get aDirContextAdapter
object). This object will then be passed to the ContextMapper implementation for transformation to the desired bean.ContextMapper implementations are typically stateless and thus reusable; they are ideal for implementing mapping logic in one place.
Alternatively, consider using an
AttributesMapper
in stead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
mapFromContext(java.lang.Object ctx)
Map a single LDAP Context to an object.
-
-
-
Method Detail
-
mapFromContext
T mapFromContext(java.lang.Object ctx) throws javax.naming.NamingException
Map a single LDAP Context to an object. The supplied Objectctx
is the object from a singleSearchResult
,Binding
, or a lookup operation.- Parameters:
ctx
- the context to map to an object. Typically this will be aDirContextAdapter
instance, unless a project specificDirObjectFactory
has been specified on theContextSource
.- Returns:
- an object built from the data in the context.
- Throws:
javax.naming.NamingException
- if an error occurs.
-
-