1 | |
package org.kuali.rice.core.api.uif; |
2 | |
|
3 | |
import org.kuali.rice.core.api.CoreConstants; |
4 | |
import org.w3c.dom.Element; |
5 | |
|
6 | |
import javax.xml.bind.annotation.XmlAccessType; |
7 | |
import javax.xml.bind.annotation.XmlAccessorType; |
8 | |
import javax.xml.bind.annotation.XmlAnyElement; |
9 | |
import javax.xml.bind.annotation.XmlElement; |
10 | |
import javax.xml.bind.annotation.XmlRootElement; |
11 | |
import javax.xml.bind.annotation.XmlType; |
12 | |
import java.util.Collection; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
@XmlRootElement(name = RemotableTextarea.Constants.ROOT_ELEMENT_NAME) |
18 | |
@XmlAccessorType(XmlAccessType.NONE) |
19 | |
@XmlType(name = RemotableTextarea.Constants.TYPE_NAME, propOrder = { |
20 | |
RemotableTextarea.Elements.ROWS, |
21 | |
RemotableTextarea.Elements.COLS, |
22 | |
RemotableTextarea.Elements.WATERMARK, |
23 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS }) |
24 | 4 | public final class RemotableTextarea extends RemotableAbstractControl implements Watermarked, RowsCols { |
25 | |
|
26 | |
@XmlElement(name = Elements.ROWS, required = false) |
27 | |
private final Integer rows; |
28 | |
|
29 | |
@XmlElement(name = Elements.COLS, required = false) |
30 | |
private final Integer cols; |
31 | |
|
32 | |
@XmlElement(name = Elements.WATERMARK, required = false) |
33 | |
private final String watermark; |
34 | |
|
35 | 6 | @SuppressWarnings("unused") |
36 | |
@XmlAnyElement |
37 | |
private final Collection<Element> _futureElements = null; |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
@SuppressWarnings("unused") |
43 | 2 | private RemotableTextarea() { |
44 | 2 | rows = null; |
45 | 2 | cols = null; |
46 | 2 | watermark = null; |
47 | 2 | } |
48 | |
|
49 | 4 | private RemotableTextarea(Builder b) { |
50 | 4 | rows = b.rows; |
51 | 4 | cols = b.cols; |
52 | 4 | watermark = b.watermark; |
53 | 4 | } |
54 | |
|
55 | |
@Override |
56 | |
public Integer getRows() { |
57 | 0 | return rows; |
58 | |
} |
59 | |
|
60 | |
@Override |
61 | |
public Integer getCols() { |
62 | 0 | return cols; |
63 | |
} |
64 | |
|
65 | |
@Override |
66 | |
public String getWatermark() { |
67 | 0 | return watermark; |
68 | |
} |
69 | |
|
70 | 16 | public static final class Builder extends RemotableAbstractControl.Builder implements Watermarked, RowsCols { |
71 | |
private Integer rows; |
72 | |
private Integer cols; |
73 | |
private String watermark; |
74 | |
|
75 | |
private Builder() { |
76 | 6 | super(); |
77 | 6 | } |
78 | |
|
79 | |
public static Builder create() { |
80 | 6 | return new Builder(); |
81 | |
} |
82 | |
|
83 | |
@Override |
84 | |
public Integer getRows() { |
85 | 0 | return rows; |
86 | |
} |
87 | |
|
88 | |
public void setRows(Integer rows) { |
89 | 8 | if (rows != null && rows < 1) { |
90 | 1 | throw new IllegalArgumentException("rows was < 1"); |
91 | |
} |
92 | |
|
93 | 7 | this.rows = rows; |
94 | 7 | } |
95 | |
|
96 | |
@Override |
97 | |
public Integer getCols() { |
98 | 0 | return cols; |
99 | |
} |
100 | |
|
101 | |
public void setCols(Integer cols) { |
102 | 8 | if (cols != null && cols < 1) { |
103 | 1 | throw new IllegalArgumentException("cols was < 1"); |
104 | |
} |
105 | |
|
106 | 7 | this.cols = cols; |
107 | 7 | } |
108 | |
|
109 | |
@Override |
110 | |
public String getWatermark() { |
111 | 0 | return watermark; |
112 | |
} |
113 | |
|
114 | |
public void setWatermark(String watermark) { |
115 | 7 | this.watermark = watermark; |
116 | 7 | } |
117 | |
|
118 | |
@Override |
119 | |
public RemotableTextarea build() { |
120 | 4 | return new RemotableTextarea(this); |
121 | |
} |
122 | |
} |
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | 0 | static final class Constants { |
128 | |
static final String TYPE_NAME = "TextareaType"; |
129 | |
final static String ROOT_ELEMENT_NAME = "textarea"; |
130 | |
} |
131 | |
|
132 | 0 | static final class Elements { |
133 | |
static final String COLS = "cols"; |
134 | |
static final String ROWS = "rows"; |
135 | |
static final String WATERMARK = "watermark"; |
136 | |
} |
137 | |
} |