1 | |
package org.kuali.rice.core.api.uif.control; |
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 | |
|
9 | |
|
10 | |
|
11 | |
@XmlAccessorType(XmlAccessType.NONE) |
12 | |
@XmlType(name = HiddenInput.Constants.TYPE_NAME) |
13 | 0 | public class HiddenInput extends AbstractControl implements HiddenInputContract { |
14 | |
@XmlElement(name = Elements.DEFAULT_VALUE, required = false) |
15 | |
private final String defaultValue; |
16 | |
|
17 | |
@Override |
18 | |
public String getDefaultValue() { |
19 | 0 | return defaultValue; |
20 | |
} |
21 | |
|
22 | 0 | private HiddenInput() { |
23 | 0 | defaultValue = null; |
24 | 0 | } |
25 | |
|
26 | |
private HiddenInput(Builder b) { |
27 | 0 | super(b); |
28 | 0 | defaultValue = b.defaultValue; |
29 | 0 | } |
30 | |
|
31 | 0 | public static final class Builder extends AbstractControl.Builder implements HiddenInputContract { |
32 | |
private String defaultValue; |
33 | |
|
34 | |
private Builder(String name) { |
35 | 0 | super(name); |
36 | 0 | } |
37 | |
|
38 | |
public static Builder create(String name) { |
39 | 0 | return new Builder(name); |
40 | |
} |
41 | |
|
42 | |
public static Builder create(TextInputContract contract) { |
43 | 0 | Builder b = create(contract.getName()); |
44 | |
|
45 | 0 | partialCreate(contract, b); |
46 | |
|
47 | 0 | b.setDefaultValue(contract.getDefaultValue()); |
48 | 0 | return b; |
49 | |
} |
50 | |
|
51 | |
@Override |
52 | |
public String getDefaultValue() { |
53 | 0 | return defaultValue; |
54 | |
} |
55 | |
|
56 | |
public void setDefaultValue(String defaultValue) { |
57 | 0 | this.defaultValue = defaultValue; |
58 | 0 | } |
59 | |
|
60 | |
@Override |
61 | |
public HiddenInput build() { |
62 | 0 | return new HiddenInput(this); |
63 | |
} |
64 | |
} |
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | 0 | static final class Constants { |
70 | |
static final String TYPE_NAME = "HiddenInputType"; |
71 | |
} |
72 | |
|
73 | 0 | static final class Elements { |
74 | |
static final String DEFAULT_VALUE = "defaultValue"; |
75 | |
} |
76 | |
} |