public abstract class AbstractContextMapper extends java.lang.Object implements ContextMapper
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 and Description |
---|
AbstractContextMapper() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.Object |
doMapFromContext(DirContextOperations ctx)
Map a single
DirContextOperation to an object. |
java.lang.Object |
mapFromContext(java.lang.Object ctx)
Map a single LDAP Context to an object.
|
public final java.lang.Object mapFromContext(java.lang.Object ctx)
ctx
is the object from a single SearchResult
,
Binding
, or a lookup operation.mapFromContext
in interface ContextMapper
ctx
- the context to map to an object. Typically this will be a
DirContextAdapter
instance, unless a project specific
DirObjectFactory
has been specified on the
ContextSource
.java.lang.ClassCastException
- if a custom DirObjectFactory
implementation is
used, causing the objects passed in be anything else than
DirContextOperations
instances.protected abstract java.lang.Object doMapFromContext(DirContextOperations ctx)
DirContextOperation
to an object. The
supplied instance is the object supplied to
mapFromContext(Object)
cast to a
DirContextOperations
.ctx
- the context to map to an object.