Spring LDAP Framework

org.springframework.ldap.core.simple
Class AbstractParameterizedContextMapper<T>

java.lang.Object
  extended by org.springframework.ldap.core.simple.AbstractParameterizedContextMapper<T>
All Implemented Interfaces:
ContextMapper, ParameterizedContextMapper<T>

public abstract class AbstractParameterizedContextMapper<T>
extends Object
implements ParameterizedContextMapper<T>

Abstract superclass that may be used instead of implementing ParameterizedContextMapper 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.

Author:
Mattias Hellborg Arthursson

Constructor Summary
AbstractParameterizedContextMapper()
           
 
Method Summary
protected abstract  T doMapFromContext(DirContextOperations ctx)
          Map a single DirContextOperation to an object.
 T mapFromContext(Object ctx)
          Map a single LDAP Context to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParameterizedContextMapper

public AbstractParameterizedContextMapper()
Method Detail

mapFromContext

public final T mapFromContext(Object ctx)
Description copied from interface: ParameterizedContextMapper
Map a single LDAP Context to an object. The supplied Object ctx is the object from a single SearchResult, Binding, or a lookup operation.

Specified by:
mapFromContext in interface ContextMapper
Specified by:
mapFromContext in interface ParameterizedContextMapper<T>
Parameters:
ctx - the context to map to an object.
Returns:
an object built from the data in the context.

doMapFromContext

protected abstract T doMapFromContext(DirContextOperations ctx)
Map a single DirContextOperation to an object. The supplied instance is the object supplied to mapFromContext(Object) cast to a DirContextOperations.

Parameters:
ctx - the context to map to an object.
Returns:
an object built from the data in the context.

Spring LDAP Framework

Copyright © 2005-2010 The Spring LDAP Framework. All Rights Reserved.