View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.ldap;
17  
18  import org.kuali.rice.kim.util.Constants;
19  import org.springframework.ldap.core.DirContextOperations;
20  import org.springframework.ldap.core.support.AbstractContextMapper;
21  
22  /**
23   * Base abstract class for mapping abstract data transfer objects from Kuali Rice into
24   * Spring LDAP. 
25   * 
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public abstract class BaseMapper<T> extends AbstractContextMapper {
29  
30  	private Constants constants;
31  	
32  	@Override
33  	public Object doMapFromContext(DirContextOperations context) {
34  		return mapDtoFromContext(context);
35  	}
36  
37  	abstract T mapDtoFromContext(DirContextOperations context);
38  	
39  
40      /**
41       * Gets the value of constants
42       *
43       * @return the value of constants
44       */
45      public final Constants getConstants() {
46          return this.constants;
47      }
48  
49      /**
50       * Sets the value of constants
51       *
52       * @param argConstants Value to assign to this.constants
53       */
54      public final void setConstants(final Constants argConstants) {
55          this.constants = argConstants;
56      }
57  	
58  }