View Javadoc

1   package org.kuali.rice.krad.uif.field;
2   
3   import java.io.Serializable;
4   import java.util.ArrayList;
5   import java.util.HashMap;
6   import java.util.List;
7   import java.util.Map;
8   
9   /**
10   * Object that is returned for Ajax attribute queries and exposed
11   * as JSON
12   *
13   * @author Kuali Rice Team (rice.collab@kuali.org)
14   */
15  public class AttributeQueryResult implements Serializable {
16      private static final long serialVersionUID = -6688384365943881516L;
17  
18      private String resultMessage;
19      private String resultMessageStyleClasses;
20  
21      private Map<String, String> resultFieldData;
22      private List<String> resultData;
23  
24      public AttributeQueryResult() {
25          resultFieldData = new HashMap<String, String>();
26          resultData = new ArrayList<String>();
27      }
28  
29      /**
30       * Message text that should display (if non empty) with the results.
31       * Can be used to given messages such as data not found
32       *
33       * @return String text to display with results
34       */
35      public String getResultMessage() {
36          return resultMessage;
37      }
38  
39      /**
40       * Setter for the result message text
41       *
42       * @param resultMessage
43       */
44      public void setResultMessage(String resultMessage) {
45          this.resultMessage = resultMessage;
46      }
47  
48      /**
49       * CSS Style classes that should be applied to the result message text
50       *
51       * @return String of CSS style classes
52       */
53      public String getResultMessageStyleClasses() {
54          return resultMessageStyleClasses;
55      }
56  
57      /**
58       * Setter for the CSS style classes to use for the return message
59       *
60       * @param resultMessageStyleClasses
61       */
62      public void setResultMessageStyleClasses(String resultMessageStyleClasses) {
63          this.resultMessageStyleClasses = resultMessageStyleClasses;
64      }
65  
66      /**
67       * Returns data for multiple fields as a Map where key is the field
68       * name and map value is the field value
69       *
70       * @return Map<String, String> result field data
71       */
72      public Map<String, String> getResultFieldData() {
73          return resultFieldData;
74      }
75  
76      /**
77       * Setter for the map field data
78       *
79       * @param resultFieldData
80       */
81      public void setResultFieldData(Map<String, String> resultFieldData) {
82          this.resultFieldData = resultFieldData;
83      }
84  
85      /**
86       * Result data as a List of string objects for queries that
87       * return single field multiple values
88       *
89       * @return List<String> result data
90       */
91      public List<String> getResultData() {
92          return resultData;
93      }
94  
95      /**
96       * Setter for the attribute query result data
97       *
98       * @param resultData
99       */
100     public void setResultData(List<String> resultData) {
101         this.resultData = resultData;
102     }
103 }