001/**
002 * Copyright 2005-2015 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kim.ldap;
017
018import org.kuali.rice.kim.util.Constants;
019import org.springframework.ldap.core.DirContextOperations;
020import org.springframework.ldap.core.support.AbstractContextMapper;
021
022/**
023 * Base abstract class for mapping abstract data transfer objects from Kuali Rice into
024 * Spring LDAP. 
025 * 
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028public abstract class BaseMapper<T> extends AbstractContextMapper {
029
030        private Constants constants;
031        
032        @Override
033        public Object doMapFromContext(DirContextOperations context) {
034                return mapDtoFromContext(context);
035        }
036
037        abstract T mapDtoFromContext(DirContextOperations context);
038        
039
040    /**
041     * Gets the value of constants
042     *
043     * @return the value of constants
044     */
045    public final Constants getConstants() {
046        return this.constants;
047    }
048
049    /**
050     * Sets the value of constants
051     *
052     * @param argConstants Value to assign to this.constants
053     */
054    public final void setConstants(final Constants argConstants) {
055        this.constants = argConstants;
056    }
057        
058}