Results 1 to 3 of 3

Thread: AbstractContextMapper class and ParameterizedContextMapper interface

  1. #1

    Post AbstractContextMapper class and ParameterizedContextMapper interface

    These two items seem to be at cross purposes. AbstractContextMapper has subclasses implement

    Code:
    protected abstract Object doMapFromContext(DirContextOperations ctx)
    The mapFromContext method is final, and returns Object.

    The ParameterizedContextMapper<T> interface includes

    Code:
    T mapFromContext(Object ctx)
    One cannot mix these two; the following declaration does not compile:

    Code:
    public class PersonContextMapper extends AbstractContextMapper
        implements ParameterizedContextMapper<Person>

    Would it be possible to combine the ideas of these two items? Could there be a ParameterizedAbstractContextMapper<T>:

    Code:
    public abstract class ParameterizedAbstractContextMapper<T>
        implements ParameterizedContextMapper<T> {
        public final T mapFromContext(Object obj) {
            return doMapFromContext((DirContextOperations) obj);
        }
        protected abstract T doMapFromContext(DirContextOperations ctx);
    }

  2. #2
    Join Date
    Mar 2005
    Location
    Landskrona, Sweden
    Posts
    505

    Default

    I think you're looiking for AbstractParameterizedContextMapper<T>, right?
    Mattias Arthursson
    Jayway AB (www.jayway.se)
    Spring-LDAP project member

  3. #3

    Default Ashamed of myself

    I apologize. I really should look harder at the Javadoc. Darn!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •