Class AbstractContextMapper<T>
java.lang.Object
org.springframework.ldap.core.support.AbstractContextMapper<T>
- All Implemented Interfaces:
ContextMapper<T>
Abstract superclass that may be used instead of implementing
ContextMapper directly. Subclassing from this superclass, the
supplied context will be automatically cast to
DirContextOperations. Note that if you use your own
DirObjectFactory, this implementation will fail with a
ClassCastException.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TMap a singleDirContextOperationto an object.final TmapFromContext(Object ctx) Map a single LDAP Context to an object.
-
Constructor Details
-
AbstractContextMapper
public AbstractContextMapper()
-
-
Method Details
-
mapFromContext
Map a single LDAP Context to an object. The supplied Objectctxis the object from a singleSearchResult,Binding, or a lookup operation.- Specified by:
mapFromContextin interfaceContextMapper<T>- Parameters:
ctx- the context to map to an object. Typically this will be aDirContextAdapterinstance, unless a project specificDirObjectFactoryhas been specified on theContextSource.- Returns:
- an object built from the data in the context.
- Throws:
ClassCastException- if a customDirObjectFactoryimplementation is used, causing the objects passed in be anything else thanDirContextOperationsinstances.
-
doMapFromContext
Map a singleDirContextOperationto an object. The supplied instance is the object supplied tomapFromContext(Object)cast to aDirContextOperations.- Parameters:
ctx- the context to map to an object.- Returns:
- an object built from the data in the context.
-