Coverage Report - org.kuali.rice.core.api.uif.RemotableTextInput
 
Classes in this File Line Coverage Branch Coverage Complexity
RemotableTextInput
83%
10/12
N/A
1.273
RemotableTextInput$1
N/A
N/A
1.273
RemotableTextInput$Builder
84%
11/13
100%
4/4
1.273
RemotableTextInput$Constants
0%
0/1
N/A
1.273
RemotableTextInput$Elements
0%
0/1
N/A
1.273
 
 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.w3c.dom.Element;
 20  
 
 21  
 import javax.xml.bind.annotation.XmlAccessType;
 22  
 import javax.xml.bind.annotation.XmlAccessorType;
 23  
 import javax.xml.bind.annotation.XmlAnyElement;
 24  
 import javax.xml.bind.annotation.XmlElement;
 25  
 import javax.xml.bind.annotation.XmlRootElement;
 26  
 import javax.xml.bind.annotation.XmlType;
 27  
 import java.util.Collection;
 28  
 
 29  
 /**
 30  
  * A text input control type.
 31  
  */
 32  
 @XmlRootElement(name = RemotableTextInput.Constants.ROOT_ELEMENT_NAME)
 33  
 @XmlAccessorType(XmlAccessType.NONE)
 34  
 @XmlType(name = RemotableTextInput.Constants.TYPE_NAME, propOrder = {
 35  
         RemotableTextInput.Elements.SIZE,
 36  
         RemotableTextInput.Elements.WATERMARK,
 37  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS })
 38  4
 public final class RemotableTextInput extends RemotableAbstractControl implements Sized, Watermarked {
 39  
 
 40  
     @XmlElement(name = Elements.SIZE, required = false)
 41  
     private final Integer size;
 42  
 
 43  
     @XmlElement(name = Elements.WATERMARK, required = false)
 44  
     private final String watermark;
 45  
 
 46  6
     @SuppressWarnings("unused")
 47  
     @XmlAnyElement
 48  
     private final Collection<Element> _futureElements = null;
 49  
 
 50  
     /**
 51  
      * Should only be invoked by JAXB.
 52  
      */
 53  
     @SuppressWarnings("unused")
 54  2
     private RemotableTextInput() {
 55  2
         size = null;
 56  2
         watermark = null;
 57  2
     }
 58  
 
 59  4
     private RemotableTextInput(Builder b) {
 60  4
         size = b.size;
 61  4
         watermark = b.watermark;
 62  4
     }
 63  
     @Override
 64  
     public Integer getSize() {
 65  0
         return size;
 66  
     }
 67  
 
 68  
     @Override
 69  
     public String getWatermark() {
 70  0
         return watermark;
 71  
     }
 72  
 
 73  12
     public static final class Builder extends RemotableAbstractControl.Builder implements Sized, Watermarked {
 74  
         private Integer size;
 75  
         private String watermark;
 76  
 
 77  
         private Builder() {
 78  5
             super();
 79  5
         }
 80  
 
 81  
         public static Builder create() {
 82  5
             return new Builder();
 83  
         }
 84  
 
 85  
         @Override
 86  
         public Integer getSize() {
 87  0
             return size;
 88  
         }
 89  
 
 90  
         public void setSize(Integer size) {
 91  7
             if (size != null && size < 1) {
 92  1
                 throw new IllegalArgumentException("size was < 1");
 93  
             }
 94  
 
 95  6
             this.size = size;
 96  6
         }
 97  
 
 98  
         @Override
 99  
         public String getWatermark() {
 100  0
             return watermark;
 101  
         }
 102  
 
 103  
         public void setWatermark(String watermark) {
 104  6
             this.watermark = watermark;
 105  6
         }
 106  
 
 107  
         @Override
 108  
         public RemotableTextInput build() {
 109  4
             return new RemotableTextInput(this);
 110  
         }
 111  
     }
 112  
 
 113  
     /**
 114  
      * Defines some internal constants used on this class.
 115  
      */
 116  0
     static final class Constants {
 117  
         static final String TYPE_NAME = "TextInputType";
 118  
         final static String ROOT_ELEMENT_NAME = "textInput";
 119  
     }
 120  
 
 121  0
     static final class Elements {
 122  
         static final String SIZE = "size";
 123  
         static final String WATERMARK = "watermark";
 124  
     }
 125  
 }