1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
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 | |
|
31 | |
|
32 | |
@XmlRootElement(name = RemotablePasswordInput.Constants.ROOT_ELEMENT_NAME) |
33 | |
@XmlAccessorType(XmlAccessType.NONE) |
34 | |
@XmlType(name = RemotablePasswordInput.Constants.TYPE_NAME, propOrder = { |
35 | |
RemotablePasswordInput.Elements.SIZE, |
36 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS }) |
37 | 0 | public final class RemotablePasswordInput extends RemotableAbstractControl implements Sized { |
38 | |
|
39 | |
@XmlElement(name = Elements.SIZE, required = false) |
40 | |
private final Integer size; |
41 | |
|
42 | |
@Override |
43 | |
public Integer getSize() { |
44 | 0 | return size; |
45 | |
} |
46 | |
|
47 | 0 | @SuppressWarnings("unused") |
48 | |
@XmlAnyElement |
49 | |
private final Collection<Element> _futureElements = null; |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
@SuppressWarnings("unused") |
55 | 0 | private RemotablePasswordInput() { |
56 | 0 | size = null; |
57 | 0 | } |
58 | |
|
59 | 0 | private RemotablePasswordInput(Builder b) { |
60 | 0 | size = b.size; |
61 | 0 | } |
62 | |
|
63 | 0 | public static final class Builder extends RemotableAbstractControl.Builder implements Sized { |
64 | |
private Integer size; |
65 | |
|
66 | |
private Builder() { |
67 | 0 | super(); |
68 | 0 | } |
69 | |
|
70 | |
public static Builder create() { |
71 | 0 | return new Builder(); |
72 | |
} |
73 | |
|
74 | |
@Override |
75 | |
public Integer getSize() { |
76 | 0 | return size; |
77 | |
} |
78 | |
|
79 | |
public void setSize(Integer size) { |
80 | 0 | if (size != null && size < 1) { |
81 | 0 | throw new IllegalArgumentException("size was < 1"); |
82 | |
} |
83 | |
|
84 | 0 | this.size = size; |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public RemotablePasswordInput build() { |
89 | 0 | return new RemotablePasswordInput(this); |
90 | |
} |
91 | |
} |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | 0 | static final class Constants { |
97 | |
static final String TYPE_NAME = "PasswordInputType"; |
98 | |
final static String ROOT_ELEMENT_NAME = "passwordInput"; |
99 | |
} |
100 | |
|
101 | 0 | static final class Elements { |
102 | |
static final String SIZE = "size"; |
103 | |
} |
104 | |
} |