1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 package org.jomc.modlet.test.support;
32
33 import java.net.URL;
34 import org.jomc.modlet.Model;
35 import org.jomc.modlet.ModelContext;
36 import org.jomc.modlet.ModelException;
37 import org.jomc.modlet.ModelValidationReport;
38 import org.jomc.modlet.ModelValidator;
39
40
41
42
43
44
45
46 public final class TestModelValidator implements ModelValidator
47 {
48
49 private boolean booleanProperty;
50
51 private char characterProperty;
52
53 private byte byteProperty;
54
55 private short shortProperty;
56
57 private int intProperty;
58
59 private long longProperty;
60
61 private float floatProperty;
62
63 private double doubleProperty;
64
65 private String stringProperty;
66
67 private String stringPropertyWithoutSetter;
68
69 private String stringPropertyWithoutGetter;
70
71 private URL urlProperty;
72
73 private Thread.State enumProperty;
74
75 private Object objectProperty;
76
77 public TestModelValidator()
78 {
79 super();
80 }
81
82 public ModelValidationReport validateModel( final ModelContext context, final Model model ) throws ModelException
83 {
84 if ( context == null )
85 {
86 throw new NullPointerException( "context" );
87 }
88 if ( model == null )
89 {
90 throw new NullPointerException( "model" );
91 }
92
93 context.setAttribute( TestModelValidator.class.getName(), this );
94 return new ModelValidationReport();
95 }
96
97 public boolean isBooleanProperty()
98 {
99 return this.booleanProperty;
100 }
101
102 public void setBooleanProperty( final boolean value )
103 {
104 this.booleanProperty = value;
105 }
106
107 public char getCharacterProperty()
108 {
109 return this.characterProperty;
110 }
111
112 public void setCharacterProperty( final char value )
113 {
114 this.characterProperty = value;
115 }
116
117 public byte getByteProperty()
118 {
119 return this.byteProperty;
120 }
121
122 public void setByteProperty( final byte value )
123 {
124 this.byteProperty = value;
125 }
126
127 public short getShortProperty()
128 {
129 return this.shortProperty;
130 }
131
132 public void setShortProperty( final short value )
133 {
134 this.shortProperty = value;
135 }
136
137 public int getIntProperty()
138 {
139 return this.intProperty;
140 }
141
142 public void setIntProperty( final int value )
143 {
144 this.intProperty = value;
145 }
146
147 public long getLongProperty()
148 {
149 return this.longProperty;
150 }
151
152 public void setLongProperty( final long value )
153 {
154 this.longProperty = value;
155 }
156
157 public float getFloatProperty()
158 {
159 return this.floatProperty;
160 }
161
162 public void setFloatProperty( final float value )
163 {
164 this.floatProperty = value;
165 }
166
167 public double getDoubleProperty()
168 {
169 return this.doubleProperty;
170 }
171
172 public void setDoubleProperty( final double value )
173 {
174 this.doubleProperty = value;
175 }
176
177 public String getStringProperty()
178 {
179 return this.stringProperty;
180 }
181
182 public void setStringProperty( final String value )
183 {
184 this.stringProperty = value;
185 }
186
187 public String getStringPropertyWithoutSetter()
188 {
189 return this.stringPropertyWithoutSetter;
190 }
191
192 public void setStringPropertyWithoutGetter( final String value )
193 {
194 this.stringPropertyWithoutGetter = value;
195 }
196
197 public URL getUrlProperty()
198 {
199 return this.urlProperty;
200 }
201
202 public void setUrlProperty( final URL value )
203 {
204 this.urlProperty = value;
205 }
206
207 public Thread.State getEnumProperty()
208 {
209 return this.enumProperty;
210 }
211
212 public void setEnumProperty( final Thread.State value )
213 {
214 this.enumProperty = value;
215 }
216
217 public Object getObjectProperty()
218 {
219 return this.objectProperty;
220 }
221
222 public void setObjectProperty( final Object value )
223 {
224 this.objectProperty = value;
225 }
226
227 }