Coverage Report - org.kuali.rice.core.api.uif.RemotableCheckboxGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
RemotableCheckboxGroup
0%
0/9
N/A
1.375
RemotableCheckboxGroup$1
N/A
N/A
1.375
RemotableCheckboxGroup$Builder
0%
0/11
0%
0/4
1.375
RemotableCheckboxGroup$Constants
0%
0/1
N/A
1.375
RemotableCheckboxGroup$Elements
0%
0/1
N/A
1.375
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.core.api.uif;
 17  
 
 18  
 import org.kuali.rice.core.api.CoreConstants;
 19  
 import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
 20  
 import org.w3c.dom.Element;
 21  
 
 22  
 import javax.xml.bind.annotation.XmlAccessType;
 23  
 import javax.xml.bind.annotation.XmlAccessorType;
 24  
 import javax.xml.bind.annotation.XmlAnyElement;
 25  
 import javax.xml.bind.annotation.XmlElement;
 26  
 import javax.xml.bind.annotation.XmlRootElement;
 27  
 import javax.xml.bind.annotation.XmlType;
 28  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 29  
 import java.util.Collection;
 30  
 import java.util.Collections;
 31  
 import java.util.HashMap;
 32  
 import java.util.Map;
 33  
 
 34  
 /**
 35  
  * A radio button group control type.
 36  
  */
 37  
 @XmlRootElement(name = RemotableCheckboxGroup.Constants.ROOT_ELEMENT_NAME)
 38  
 @XmlAccessorType(XmlAccessType.NONE)
 39  
 @XmlType(name = RemotableCheckboxGroup.Constants.TYPE_NAME, propOrder = {
 40  
                 RemotableCheckboxGroup.Elements.KEY_LABELS,
 41  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS })
 42  0
 public final class RemotableCheckboxGroup extends RemotableAbstractControl implements KeyLabeled {
 43  
 
 44  
     @XmlElement(name = Elements.KEY_LABELS, required = true)
 45  
     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 46  
     private final Map<String, String> keyLabels;
 47  
 
 48  0
     @SuppressWarnings("unused")
 49  
     @XmlAnyElement
 50  
     private final Collection<Element> _futureElements = null;
 51  
 
 52  
     /**
 53  
      * Should only be invoked by JAXB.
 54  
      */
 55  
     @SuppressWarnings("unused")
 56  0
     private RemotableCheckboxGroup() {
 57  0
         keyLabels = null;
 58  0
     }
 59  
 
 60  0
     private RemotableCheckboxGroup(Builder b) {
 61  0
         keyLabels = b.keyLabels;
 62  0
     }
 63  
 
 64  
     @Override
 65  
     public Map<String, String> getKeyLabels() {
 66  0
         return keyLabels;
 67  
     }
 68  
 
 69  0
     public static final class Builder extends RemotableAbstractControl.Builder implements KeyLabeled {
 70  
         private Map<String, String> keyLabels;
 71  
 
 72  0
         private Builder(Map<String, String> keyLabels) {
 73  0
             setKeyLabels(keyLabels);
 74  0
         }
 75  
 
 76  
         public static Builder create(Map<String, String> keyLabels) {
 77  0
             return new Builder(keyLabels);
 78  
         }
 79  
 
 80  
         @Override
 81  
         public Map<String, String> getKeyLabels() {
 82  0
             return keyLabels;
 83  
         }
 84  
 
 85  
         public void setKeyLabels(Map<String, String> keyLabels) {
 86  0
             if (keyLabels == null || keyLabels.isEmpty()) {
 87  0
                 throw new IllegalArgumentException("keyLabels must be non-null & non-empty");
 88  
             }
 89  
 
 90  0
             this.keyLabels = Collections.unmodifiableMap(new HashMap<String, String>(keyLabels));
 91  0
         }
 92  
 
 93  
         @Override
 94  
         public RemotableCheckboxGroup build() {
 95  0
             return new RemotableCheckboxGroup(this);
 96  
         }
 97  
     }
 98  
 
 99  
     /**
 100  
      * Defines some internal constants used on this class.
 101  
      */
 102  0
     static final class Constants {
 103  
         static final String TYPE_NAME = "CheckboxGroupType";
 104  
         final static String ROOT_ELEMENT_NAME = "checkboxGroup";
 105  
     }
 106  
 
 107  0
     static final class Elements {
 108  
         static final String KEY_LABELS = "keyLabels";
 109  
     }
 110  
 }