View Javadoc
1   /*
2    * Copyright 2007 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.ole.module.purap.dataaccess.impl;
17  
18  import org.apache.ojb.broker.accesslayer.QueryCustomizerDefaultImpl;
19  
20  import java.lang.reflect.Field;
21  import java.util.Map;
22  
23  /**
24   * Contains methods of use to other QueryCustomizers
25   */
26  public abstract class KualiQueryCustomizerDefaultImpl extends QueryCustomizerDefaultImpl {
27      /**
28       * exposes the list of attributes specified in the ojb file.  This is necessary since
29       * the super class does not expose this.
30       *
31       * @return a list of attributes
32       */
33      public Map<String, String> getAttributes() {
34          // this is necessary since the attributes are not exposed as a list by default
35          Field field = null;
36          try {
37              field = KualiQueryCustomizerDefaultImpl.class.getSuperclass().getDeclaredField("m_attributeList");
38          } catch (Exception e) {
39              throw new RuntimeException(e);
40          }
41          field.setAccessible(true);
42          Map<String, String> m_attributeList = null;
43          try {
44              m_attributeList = (Map) field.get(this);
45          } catch (Exception e) {
46              throw new RuntimeException(e);
47          }
48          return m_attributeList;
49      }
50  }