1 | |
package org.kuali.rice.core.api.uif; |
2 | |
|
3 | |
import javax.xml.bind.annotation.XmlAccessType; |
4 | |
import javax.xml.bind.annotation.XmlAccessorType; |
5 | |
import javax.xml.bind.annotation.XmlElement; |
6 | |
import javax.xml.bind.annotation.XmlType; |
7 | |
|
8 | |
@XmlAccessorType(XmlAccessType.NONE) |
9 | |
@XmlType(name = HiddenInput.Constants.TYPE_NAME) |
10 | 0 | public class HiddenInput extends AbstractControl implements Sized { |
11 | |
|
12 | |
@XmlElement(name = Elements.SIZE, required = false) |
13 | |
private final Integer size; |
14 | |
|
15 | |
@Override |
16 | |
public Integer getSize() { |
17 | 0 | return size; |
18 | |
} |
19 | |
|
20 | 0 | private HiddenInput() { |
21 | 0 | size = null; |
22 | 0 | } |
23 | |
|
24 | 0 | private HiddenInput(Builder b) { |
25 | 0 | size = b.size; |
26 | 0 | } |
27 | |
|
28 | 0 | public static final class Builder extends AbstractControl.Builder implements Sized { |
29 | |
private Integer size; |
30 | |
|
31 | |
private Builder() { |
32 | 0 | super(); |
33 | 0 | } |
34 | |
|
35 | |
public static Builder create() { |
36 | 0 | return new Builder(); |
37 | |
} |
38 | |
|
39 | |
@Override |
40 | |
public Integer getSize() { |
41 | 0 | return size; |
42 | |
} |
43 | |
|
44 | |
public void setSize(Integer size) { |
45 | 0 | if (size != null && size < 1) { |
46 | 0 | throw new IllegalArgumentException("size was < 1"); |
47 | |
} |
48 | |
|
49 | 0 | this.size = size; |
50 | 0 | } |
51 | |
|
52 | |
@Override |
53 | |
public HiddenInput build() { |
54 | 0 | return new HiddenInput(this); |
55 | |
} |
56 | |
} |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | 0 | static final class Constants { |
62 | |
static final String TYPE_NAME = "HiddenInputType"; |
63 | |
} |
64 | |
|
65 | 0 | static final class Elements { |
66 | |
static final String SIZE = "size"; |
67 | |
} |
68 | |
} |