Coverage Report - javax.faces.internal.SavedState
 
Classes in this File Line Coverage Branch Coverage Complexity
SavedState
88%
28/32
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
 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,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package javax.faces.internal;
 17  
 
 18  
 import java.io.Serializable;
 19  
 
 20  
 import javax.faces.component.EditableValueHolder;
 21  
 
 22  
 /**
 23  
  * @author shot
 24  
  * @author manhole
 25  
  * 
 26  
  * This class might be changed without notice. Please do not use it
 27  
  * excluding the JSF specification part.
 28  
  */
 29  
 public class SavedState implements Serializable {
 30  
 
 31  
     private static final long serialVersionUID = 3688791349478568242L;
 32  
 
 33  33
     private Object localValue = null;
 34  
 
 35  33
     private Object submittedValue = null;
 36  
 
 37  33
     private boolean valid = true;
 38  
 
 39  33
     private boolean localValueSet = false;
 40  
 
 41  33
     public SavedState() {
 42  33
     }
 43  
 
 44  
     public Object getLocalValue() {
 45  21
         return localValue;
 46  
     }
 47  
 
 48  
     public void setLocalValue(Object localValue) {
 49  21
         this.localValue = localValue;
 50  21
     }
 51  
 
 52  
     public boolean isLocalValueSet() {
 53  21
         return localValueSet;
 54  
     }
 55  
 
 56  
     public void setLocalValueSet(boolean localValueSet) {
 57  21
         this.localValueSet = localValueSet;
 58  21
     }
 59  
 
 60  
     public Object getSubmittedValue() {
 61  21
         return submittedValue;
 62  
     }
 63  
 
 64  
     public void setSubmittedValue(Object submittedValue) {
 65  21
         this.submittedValue = submittedValue;
 66  21
     }
 67  
 
 68  
     public boolean isValid() {
 69  21
         return valid;
 70  
     }
 71  
 
 72  
     public void setValid(boolean valid) {
 73  21
         this.valid = valid;
 74  21
     }
 75  
 
 76  
     public void save(EditableValueHolder holder) {
 77  21
         setLocalValue(holder.getLocalValue());
 78  21
         setLocalValueSet(holder.isLocalValueSet());
 79  21
         setValid(holder.isValid());
 80  21
         setSubmittedValue(holder.getSubmittedValue());
 81  21
     }
 82  
 
 83  
     public void restore(EditableValueHolder holder) {
 84  21
         holder.setValue(getLocalValue());
 85  21
         holder.setLocalValueSet(isLocalValueSet());
 86  21
         holder.setValid(isValid());
 87  21
         holder.setSubmittedValue(getSubmittedValue());
 88  21
     }
 89  
 
 90  
     public void save(ComponentStatesHolder holder) {
 91  0
         holder.save(this);
 92  0
     }
 93  
 
 94  
     public void restore(ComponentStatesHolder holder) {
 95  0
         holder.restore(this);
 96  0
     }
 97  
 
 98  
 }