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.ModelProcessor;
38 import org.jomc.modlet.test.TestComplexType;
39 import static org.junit.Assert.assertNotNull;
40
41
42
43
44
45
46
47 public final class TestModelProcessor implements ModelProcessor
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 TestModelProcessor()
79 {
80 super();
81 }
82
83 public Model processModel( 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( TestModelProcessor.class.getName(), this );
95
96 final Model processed = model.clone();
97 final TestComplexType t = processed.getAnyObject( TestComplexType.class );
98 assertNotNull( t );
99
100 t.getAny().add( new TestComplexType() );
101 return processed;
102 }
103
104 public boolean isBooleanProperty()
105 {
106 return this.booleanProperty;
107 }
108
109 public void setBooleanProperty( final boolean value )
110 {
111 this.booleanProperty = value;
112 }
113
114 public char getCharacterProperty()
115 {
116 return this.characterProperty;
117 }
118
119 public void setCharacterProperty( final char value )
120 {
121 this.characterProperty = value;
122 }
123
124 public byte getByteProperty()
125 {
126 return this.byteProperty;
127 }
128
129 public void setByteProperty( final byte value )
130 {
131 this.byteProperty = value;
132 }
133
134 public short getShortProperty()
135 {
136 return this.shortProperty;
137 }
138
139 public void setShortProperty( final short value )
140 {
141 this.shortProperty = value;
142 }
143
144 public int getIntProperty()
145 {
146 return this.intProperty;
147 }
148
149 public void setIntProperty( final int value )
150 {
151 this.intProperty = value;
152 }
153
154 public long getLongProperty()
155 {
156 return this.longProperty;
157 }
158
159 public void setLongProperty( final long value )
160 {
161 this.longProperty = value;
162 }
163
164 public float getFloatProperty()
165 {
166 return this.floatProperty;
167 }
168
169 public void setFloatProperty( final float value )
170 {
171 this.floatProperty = value;
172 }
173
174 public double getDoubleProperty()
175 {
176 return this.doubleProperty;
177 }
178
179 public void setDoubleProperty( final double value )
180 {
181 this.doubleProperty = value;
182 }
183
184 public String getStringProperty()
185 {
186 return this.stringProperty;
187 }
188
189 public void setStringProperty( final String value )
190 {
191 this.stringProperty = value;
192 }
193
194 public String getStringPropertyWithoutSetter()
195 {
196 return this.stringPropertyWithoutSetter;
197 }
198
199 public void setStringPropertyWithoutGetter( final String value )
200 {
201 this.stringPropertyWithoutGetter = value;
202 }
203
204 public URL getUrlProperty()
205 {
206 return this.urlProperty;
207 }
208
209 public void setUrlProperty( final URL value )
210 {
211 this.urlProperty = value;
212 }
213
214 public Thread.State getEnumProperty()
215 {
216 return this.enumProperty;
217 }
218
219 public void setEnumProperty( final Thread.State value )
220 {
221 this.enumProperty = value;
222 }
223
224 public Object getObjectProperty()
225 {
226 return this.objectProperty;
227 }
228
229 public void setObjectProperty( final Object value )
230 {
231 this.objectProperty = value;
232 }
233
234 }