01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.purap.dao.ojb;
17:
18: import java.lang.reflect.Field;
19: import java.util.Map;
20:
21: import org.apache.ojb.broker.accesslayer.QueryCustomizerDefaultImpl;
22:
23: /**
24: *
25: * Contains methods of use to other QueryCustomizers
26: */
27: public abstract class KualiQueryCustomizerDefaultImpl extends
28: QueryCustomizerDefaultImpl {
29: /**
30: * exposes the list of attributes specified in the ojb file. This is necessary since
31: * the super class does not expose this.
32: * @return a list of attributes
33: */
34: public Map<String, String> getAttributes() {
35: // this is necessary since the attributes are not exposed as a list by default
36: Field field = null;
37: try {
38: field = KualiQueryCustomizerDefaultImpl.class
39: .getSuperclass()
40: .getDeclaredField("m_attributeList");
41: } catch (Exception e) {
42: throw new RuntimeException(e);
43: }
44: field.setAccessible(true);
45: Map<String, String> m_attributeList = null;
46: try {
47: m_attributeList = (Map) field.get(this );
48: } catch (Exception e) {
49: throw new RuntimeException(e);
50: }
51: return m_attributeList;
52: }
53: }
|