001/* 002 * Copyright (C) Christian Schulte, 2005-206 003 * All rights reserved. 004 * 005 * Redistribution and use in source and binary forms, with or without 006 * modification, are permitted provided that the following conditions 007 * are met: 008 * 009 * o Redistributions of source code must retain the above copyright 010 * notice, this list of conditions and the following disclaimer. 011 * 012 * o Redistributions in binary form must reproduce the above copyright 013 * notice, this list of conditions and the following disclaimer in 014 * the documentation and/or other materials provided with the 015 * distribution. 016 * 017 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 018 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 019 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 020 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, 021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 027 * 028 * $JOMC: TestUnmarshallerListener.java 4654 2012-11-15 22:28:26Z schulte $ 029 * 030 */ 031package org.jomc.modlet.test.support; 032 033import java.net.URL; 034import javax.xml.bind.Unmarshaller; 035 036/** 037 * {@code Unmarshaller.Listener} test implementation. 038 * 039 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 1.0 040 * @version $JOMC: TestUnmarshallerListener.java 4654 2012-11-15 22:28:26Z schulte $ 041 */ 042public final class TestUnmarshallerListener extends Unmarshaller.Listener 043{ 044 045 private boolean booleanProperty; 046 047 private boolean boxedBooleanProperty; 048 049 private Boolean unboxedBooleanProperty; 050 051 private char characterProperty; 052 053 private char boxedCharacterProperty; 054 055 private Character unboxedCharacterProperty; 056 057 private byte byteProperty; 058 059 private byte boxedByteProperty; 060 061 private Byte unboxedByteProperty; 062 063 private short shortProperty; 064 065 private short boxedShortProperty; 066 067 private Short unboxedShortProperty; 068 069 private int intProperty; 070 071 private int boxedIntProperty; 072 073 private Integer unboxedIntProperty; 074 075 private long longProperty; 076 077 private long boxedLongProperty; 078 079 private Long unboxedLongProperty; 080 081 private float floatProperty; 082 083 private float boxedFloatProperty; 084 085 private Float unboxedFloatProperty; 086 087 private double doubleProperty; 088 089 private double boxedDoubleProperty; 090 091 private Double unboxedDoubleProperty; 092 093 private String stringProperty; 094 095 private URL urlProperty; 096 097 private Thread.State enumProperty; 098 099 private Object objectProperty; 100 101 private String stringPropertyWithoutSetter; 102 103 private String stringPropertyWithoutGetter; 104 105 private Math unsupportedPropertyType; 106 107 private InstantiationExceptionPropertyType instantiationExceptionProperty; 108 109 private InvocationTargetExceptionPropertyType invocationTargetExceptionProperty; 110 111 /** Creates a new {@code TestUnmarshallerListener} instance. */ 112 public TestUnmarshallerListener() 113 { 114 super(); 115 } 116 117 @Override 118 public void beforeUnmarshal( final Object target, final Object parent ) 119 { 120 System.out.println( this.getClass().getName() + ": beforeUnmarshal(" + target + ", " + parent + ")" ); 121 } 122 123 @Override 124 public void afterUnmarshal( final Object target, final Object parent ) 125 { 126 System.out.println( this.getClass().getName() + ": afterUnmarshal(" + target + ", " + parent + ")" ); 127 } 128 129 public boolean isBooleanProperty() 130 { 131 return this.booleanProperty; 132 } 133 134 public void setBooleanProperty( final boolean value ) 135 { 136 this.booleanProperty = value; 137 } 138 139 public Boolean isBoxedBooleanProperty() 140 { 141 return this.boxedBooleanProperty; 142 } 143 144 public void setBoxedBooleanProperty( final boolean value ) 145 { 146 this.boxedBooleanProperty = value; 147 } 148 149 public boolean isUnboxedBooleanProperty() 150 { 151 return this.unboxedBooleanProperty ? true : false; 152 } 153 154 public void setUnboxedBooleanProperty( final Boolean value ) 155 { 156 this.unboxedBooleanProperty = value; 157 } 158 159 public char getCharacterProperty() 160 { 161 return this.characterProperty; 162 } 163 164 public void setCharacterProperty( final char value ) 165 { 166 this.characterProperty = value; 167 } 168 169 public Character getBoxedCharacterProperty() 170 { 171 return this.boxedCharacterProperty; 172 } 173 174 public void setBoxedCharacterProperty( final char value ) 175 { 176 this.boxedCharacterProperty = value; 177 } 178 179 public char getUnboxedCharacterProperty() 180 { 181 return this.unboxedCharacterProperty; 182 } 183 184 public void setUnboxedCharacterProperty( final Character value ) 185 { 186 this.unboxedCharacterProperty = value; 187 } 188 189 public byte getByteProperty() 190 { 191 return this.byteProperty; 192 } 193 194 public void setByteProperty( final byte value ) 195 { 196 this.byteProperty = value; 197 } 198 199 public Byte getBoxedByteProperty() 200 { 201 return this.boxedByteProperty; 202 } 203 204 public void setBoxedByteProperty( final byte value ) 205 { 206 this.boxedByteProperty = value; 207 } 208 209 public byte getUnboxedByteProperty() 210 { 211 return this.unboxedByteProperty; 212 } 213 214 public void setUnboxedByteProperty( final Byte value ) 215 { 216 this.unboxedByteProperty = value; 217 } 218 219 public short getShortProperty() 220 { 221 return this.shortProperty; 222 } 223 224 public void setShortProperty( final short value ) 225 { 226 this.shortProperty = value; 227 } 228 229 public Short getBoxedShortProperty() 230 { 231 return this.boxedShortProperty; 232 } 233 234 public void setBoxedShortProperty( final short value ) 235 { 236 this.boxedShortProperty = value; 237 } 238 239 public short getUnboxedShortProperty() 240 { 241 return this.unboxedShortProperty; 242 } 243 244 public void setUnboxedShortProperty( final Short value ) 245 { 246 this.unboxedShortProperty = value; 247 } 248 249 public int getIntProperty() 250 { 251 return this.intProperty; 252 } 253 254 public void setIntProperty( final int value ) 255 { 256 this.intProperty = value; 257 } 258 259 public Integer getBoxedIntProperty() 260 { 261 return this.boxedIntProperty; 262 } 263 264 public void setBoxedIntProperty( final int value ) 265 { 266 this.boxedIntProperty = value; 267 } 268 269 public int getUnboxedIntProperty() 270 { 271 return this.unboxedIntProperty; 272 } 273 274 public void setUnboxedIntProperty( final Integer value ) 275 { 276 this.unboxedIntProperty = value; 277 } 278 279 public long getLongProperty() 280 { 281 return this.longProperty; 282 } 283 284 public void setLongProperty( final long value ) 285 { 286 this.longProperty = value; 287 } 288 289 public Long getBoxedLongProperty() 290 { 291 return this.boxedLongProperty; 292 } 293 294 public void setBoxedLongProperty( final long value ) 295 { 296 this.boxedLongProperty = value; 297 } 298 299 public long getUnboxedLongProperty() 300 { 301 return this.unboxedLongProperty; 302 } 303 304 public void setUnboxedLongProperty( final Long value ) 305 { 306 this.unboxedLongProperty = value; 307 } 308 309 public float getFloatProperty() 310 { 311 return this.floatProperty; 312 } 313 314 public void setFloatProperty( final float value ) 315 { 316 this.floatProperty = value; 317 } 318 319 public Float getBoxedFloatProperty() 320 { 321 return this.boxedFloatProperty; 322 } 323 324 public void setBoxedFloatProperty( final float value ) 325 { 326 this.boxedFloatProperty = value; 327 } 328 329 public float getUnboxedFloatProperty() 330 { 331 return this.unboxedFloatProperty; 332 } 333 334 public void setUnboxedFloatProperty( final Float value ) 335 { 336 this.unboxedFloatProperty = value; 337 } 338 339 public double getDoubleProperty() 340 { 341 return this.doubleProperty; 342 } 343 344 public void setDoubleProperty( final double value ) 345 { 346 this.doubleProperty = value; 347 } 348 349 public Double getBoxedDoubleProperty() 350 { 351 return this.boxedDoubleProperty; 352 } 353 354 public void setBoxedDoubleProperty( final double value ) 355 { 356 this.boxedDoubleProperty = value; 357 } 358 359 public double getUnboxedDoubleProperty() 360 { 361 return this.unboxedDoubleProperty; 362 } 363 364 public void setUnboxedDoubleProperty( final Double value ) 365 { 366 this.unboxedDoubleProperty = value; 367 } 368 369 public String getStringProperty() 370 { 371 return this.stringProperty; 372 } 373 374 public void setStringProperty( final String value ) 375 { 376 this.stringProperty = value; 377 } 378 379 public String getStringPropertyWithoutSetter() 380 { 381 return this.stringPropertyWithoutSetter; 382 } 383 384 public void setStringPropertyWithoutGetter( final String value ) 385 { 386 this.stringPropertyWithoutGetter = value; 387 } 388 389 public URL getUrlProperty() 390 { 391 return this.urlProperty; 392 } 393 394 public void setUrlProperty( final URL value ) 395 { 396 this.urlProperty = value; 397 } 398 399 public Thread.State getEnumProperty() 400 { 401 return this.enumProperty; 402 } 403 404 public void setEnumProperty( final Thread.State value ) 405 { 406 this.enumProperty = value; 407 } 408 409 public Object getObjectProperty() 410 { 411 return this.objectProperty; 412 } 413 414 public void setObjectProperty( final Object value ) 415 { 416 this.objectProperty = value; 417 } 418 419 public Math getUnsupportedPropertyType() 420 { 421 return this.unsupportedPropertyType; 422 } 423 424 public void setUnsupportedPropertyType( final Math value ) 425 { 426 this.unsupportedPropertyType = value; 427 } 428 429 public InstantiationExceptionPropertyType getInstantiationExceptionProperty() 430 { 431 return this.instantiationExceptionProperty; 432 } 433 434 public void setInstantiationExceptionProperty( final InstantiationExceptionPropertyType value ) 435 { 436 this.instantiationExceptionProperty = value; 437 } 438 439 public InvocationTargetExceptionPropertyType getInvocationTargetExceptionProperty() 440 { 441 return this.invocationTargetExceptionProperty; 442 } 443 444 public void setInvocationTargetExceptionProperty( final InvocationTargetExceptionPropertyType value ) 445 { 446 this.invocationTargetExceptionProperty = value; 447 } 448 449}