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