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.ModelContext;
35 import org.jomc.modlet.ModelException;
36 import org.jomc.modlet.ModelProcessor;
37 import org.jomc.modlet.ModelProvider;
38 import org.jomc.modlet.ModelValidator;
39 import org.jomc.modlet.Modlet;
40 import org.jomc.modlet.ModletProvider;
41 import org.jomc.modlet.Modlets;
42 import org.jomc.modlet.Service;
43 import org.jomc.modlet.Services;
44
45
46
47
48
49
50
51 public final class TestModletProvider implements ModletProvider
52 {
53
54 private boolean booleanProperty;
55
56 private char characterProperty;
57
58 private byte byteProperty;
59
60 private short shortProperty;
61
62 private int intProperty;
63
64 private long longProperty;
65
66 private float floatProperty;
67
68 private double doubleProperty;
69
70 private String stringProperty;
71
72 private String stringPropertyWithoutSetter;
73
74 private String stringPropertyWithoutGetter;
75
76 private URL urlProperty;
77
78 private Thread.State enumProperty;
79
80 private Object objectProperty;
81
82 private Math unsupportedPropertyType;
83
84 private InstantiationExceptionPropertyType instantiationExceptionProperty;
85
86 private InvocationTargetExceptionPropertyType invocationTargetExceptionProperty;
87
88 public TestModletProvider()
89 {
90 super();
91 }
92
93 public Modlets findModlets( final ModelContext context ) throws ModelException
94 {
95 final Modlets modlets = new Modlets();
96 final Modlet modlet = new Modlet();
97 modlets.getModlet().add( modlet );
98 modlet.setName( TestModletProvider.class.getName() );
99 modlet.setModel( TestModletProvider.class.getName() );
100 modlet.setServices( new Services() );
101
102 Service s = new Service();
103 s.setClazz( TestModelProvider.class.getName() );
104 s.setIdentifier( ModelProvider.class.getName() );
105 modlet.getServices().getService().add( s );
106
107 s = new Service();
108 s.setClazz( TestModelProcessor.class.getName() );
109 s.setIdentifier( ModelProcessor.class.getName() );
110 modlet.getServices().getService().add( s );
111
112 s = new Service();
113 s.setClazz( TestModelValidator.class.getName() );
114 s.setIdentifier( ModelValidator.class.getName() );
115 modlet.getServices().getService().add( s );
116
117 context.setAttribute( TestModletProvider.class.getName(), this );
118 return modlets;
119 }
120
121 public boolean isBooleanProperty()
122 {
123 return this.booleanProperty;
124 }
125
126 public void setBooleanProperty( final boolean value )
127 {
128 this.booleanProperty = value;
129 }
130
131 public char getCharacterProperty()
132 {
133 return this.characterProperty;
134 }
135
136 public void setCharacterProperty( final char value )
137 {
138 this.characterProperty = value;
139 }
140
141 public byte getByteProperty()
142 {
143 return this.byteProperty;
144 }
145
146 public void setByteProperty( final byte value )
147 {
148 this.byteProperty = value;
149 }
150
151 public short getShortProperty()
152 {
153 return this.shortProperty;
154 }
155
156 public void setShortProperty( final short value )
157 {
158 this.shortProperty = value;
159 }
160
161 public int getIntProperty()
162 {
163 return this.intProperty;
164 }
165
166 public void setIntProperty( final int value )
167 {
168 this.intProperty = value;
169 }
170
171 public long getLongProperty()
172 {
173 return this.longProperty;
174 }
175
176 public void setLongProperty( final long value )
177 {
178 this.longProperty = value;
179 }
180
181 public float getFloatProperty()
182 {
183 return this.floatProperty;
184 }
185
186 public void setFloatProperty( final float value )
187 {
188 this.floatProperty = value;
189 }
190
191 public double getDoubleProperty()
192 {
193 return this.doubleProperty;
194 }
195
196 public void setDoubleProperty( final double value )
197 {
198 this.doubleProperty = value;
199 }
200
201 public String getStringProperty()
202 {
203 return this.stringProperty;
204 }
205
206 public void setStringProperty( final String value )
207 {
208 this.stringProperty = value;
209 }
210
211 public String getStringPropertyWithoutSetter()
212 {
213 return this.stringPropertyWithoutSetter;
214 }
215
216 public void setStringPropertyWithoutGetter( final String value )
217 {
218 this.stringPropertyWithoutGetter = value;
219 }
220
221 public URL getUrlProperty()
222 {
223 return this.urlProperty;
224 }
225
226 public void setUrlProperty( final URL value )
227 {
228 this.urlProperty = value;
229 }
230
231 public Thread.State getEnumProperty()
232 {
233 return this.enumProperty;
234 }
235
236 public void setEnumProperty( final Thread.State value )
237 {
238 this.enumProperty = value;
239 }
240
241 public Object getObjectProperty()
242 {
243 return this.objectProperty;
244 }
245
246 public void setObjectProperty( final Object value )
247 {
248 this.objectProperty = value;
249 }
250
251 public Math getUnsupportedPropertyType()
252 {
253 return this.unsupportedPropertyType;
254 }
255
256 public void setUnsupportedPropertyType( final Math value )
257 {
258 this.unsupportedPropertyType = value;
259 }
260
261 public InstantiationExceptionPropertyType getInstantiationExceptionProperty()
262 {
263 return this.instantiationExceptionProperty;
264 }
265
266 public void setInstantiationExceptionProperty( final InstantiationExceptionPropertyType value )
267 {
268 this.instantiationExceptionProperty = value;
269 }
270
271 public InvocationTargetExceptionPropertyType getInvocationTargetExceptionProperty()
272 {
273 return this.invocationTargetExceptionProperty;
274 }
275
276 public void setInvocationTargetExceptionProperty( final InvocationTargetExceptionPropertyType value )
277 {
278 this.invocationTargetExceptionProperty = value;
279 }
280
281 }