Clover Coverage Report - KS Common 1.2-M6-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Sep 12 2011 05:50:56 EDT
../../../../../../../../img/srcFileCovDistChart0.png 30% of files have more coverage
18   112   12   1.64
2   71   0.67   11
11     1.09  
1    
 
  ReferenceModel       Line # 36 18 0% 12 31 0% 0.0
 
No Tests
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.ui.client.mvc.dto;
17   
18    import java.util.HashMap;
19    import java.util.Map;
20   
21    import org.kuali.student.common.ui.client.configurable.mvc.HasReferenceId;
22    import org.kuali.student.common.ui.client.mvc.Model;
23    import org.kuali.student.common.ui.client.mvc.ModelChangeEvent;
24    import org.kuali.student.common.ui.client.mvc.ModelChangeHandler;
25    import org.kuali.student.common.ui.client.mvc.ModelChangeEvent.Action;
26   
27    import com.google.gwt.event.shared.HandlerManager;
28    import com.google.gwt.event.shared.HandlerRegistration;
29   
30    /**
31    * A small model that contains id, type, and state
32    *
33    * @author Kuali Student Team
34    *
35    */
 
36    public class ReferenceModel implements HasReferenceId, Model {
37    String referenceId;
38    String referenceTypeKey;
39    String referenceType;
40    String referenceState;
41    Map<String, String> referenceAttributes; // Use referenceAttributes to store misc data from the parent Model
42    private HandlerManager handlers = new HandlerManager(this);
43   
 
44  0 toggle @Override
45    public HandlerRegistration addModelChangeHandler(
46    ModelChangeHandler handler) {
47  0 return handlers.addHandler(ModelChangeEvent.TYPE, handler);
48    }
49   
50    /**
51    * @see org.kuali.student.common.ui.client.configurable.mvc.HasReferenceId#setReferenceId(java.lang.String)
52    */
 
53  0 toggle @Override
54    public void setReferenceId(String id) {
55  0 this.referenceId = id;
56  0 handlers.fireEvent(new ModelChangeEvent(Action.RELOAD, this));
57    }
58   
59    /**
60    * @see org.kuali.student.common.ui.client.configurable.mvc.HasReferenceId#setReferenceKey(java.lang.String)
61    */
 
62  0 toggle @Override
63    public String getReferenceId() {
64  0 return referenceId;
65    }
66   
 
67  0 toggle @Override
68    public String getReferenceTypeKey() {
69  0 return referenceTypeKey;
70    }
71   
 
72  0 toggle @Override
73    public void setReferenceTypeKey(String referenceTypeKey) {
74  0 this.referenceTypeKey = referenceTypeKey;
75  0 handlers.fireEvent(new ModelChangeEvent(Action.RELOAD, this));
76    }
77   
 
78  0 toggle @Override
79    public String getReferenceType() {
80  0 return referenceType;
81    }
82   
 
83  0 toggle @Override
84    public void setReferenceType(String referenceType) {
85  0 this.referenceType = referenceType;
86  0 handlers.fireEvent(new ModelChangeEvent(Action.RELOAD, this));
87    }
88   
 
89  0 toggle @Override
90    public String getReferenceState() {
91  0 return referenceState;
92    }
93   
 
94  0 toggle @Override
95    public void setReferenceState(String referenceState) {
96  0 this.referenceState = referenceState;
97  0 handlers.fireEvent(new ModelChangeEvent(Action.RELOAD, this));
98    }
99   
 
100  0 toggle public Map<String, String> getReferenceAttributes(){
101  0 if(referenceAttributes!=null){
102  0 return referenceAttributes;
103    }
104    else{
105  0 return new HashMap<String,String>();
106    }
107    }
 
108  0 toggle public void setReferenceAttributes(Map<String, String> referenceAttributes){
109  0 this.referenceAttributes = referenceAttributes;
110  0 handlers.fireEvent(new ModelChangeEvent(Action.RELOAD, this));
111    }
112    }