View Javadoc
1   /**
2    * Copyright 2005-2016 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.krad.uif.util;
17  
18  import java.util.Map;
19  
20  import org.kuali.rice.krad.inquiry.Inquirable;
21  import org.kuali.rice.krad.uif.widget.Inquiry;
22  
23  /**
24   * Mock inquirable implementation for UIF unit tests. 
25   * 
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public class MockInquirable implements Inquirable {
29      
30      private Class<?> dataObjectClass;
31      private String viewName;
32      
33      /**
34       * Create a mock inqurable instance based on data object class and view name.
35       * 
36       * @param dataObjectClass The data object class.
37       * @param viewName The view name.
38       */
39      MockInquirable(Class<?> dataObjectClass, String viewName) {
40          this.dataObjectClass = dataObjectClass;
41          this.viewName = viewName;
42      }
43  
44      /**
45       * {@inheritDoc}
46       */
47      @Override
48      public Class<?> getDataObjectClass() {
49          return dataObjectClass;
50      }
51  
52      /**
53       * {@inheritDoc}
54       */
55      @Override
56      public void setDataObjectClass(Class<?> dataObjectClass) {
57          this.dataObjectClass = dataObjectClass;
58      }
59  
60      /**
61       * @see org.kuali.rice.krad.inquiry.Inquirable#retrieveDataObject(java.util.Map)
62       */
63      @Override
64      public Object retrieveDataObject(Map<String, String> fieldValues) {
65          return null;
66      }
67  
68      /**
69       * @see org.kuali.rice.krad.inquiry.Inquirable#buildInquirableLink(java.lang.Object, java.lang.String, org.kuali.rice.krad.uif.widget.Inquiry)
70       */
71      @Override
72      public void buildInquirableLink(Object dataObject, String propertyName, Inquiry inquiry) {
73      }
74  
75  }