1 5 package com.tctest; 6 7 import com.tc.object.bytecode.ClassAdapterBase; 8 import com.tc.object.bytecode.Manageable; 9 import com.tc.object.config.ConfigVisitor; 10 import com.tc.object.config.DSOClientConfigHelper; 11 import com.tc.object.tx.ReadOnlyException; 12 import com.tc.simulator.app.ApplicationConfig; 13 import com.tc.simulator.listener.ListenerProvider; 14 import com.tc.util.Assert; 15 16 import java.awt.Color ; 17 import java.lang.reflect.Field ; 18 import java.util.ArrayList ; 19 import java.util.HashMap ; 20 import java.util.List ; 21 import java.util.Map ; 22 23 public class ReflectionFieldTestApp extends GenericTestApp { 24 private DataRoot reflectionRoot = null; 26 private Integer literalRoot; private int primitiveRoot; 29 private DataRoot nonShared = new DataRoot(); 30 private NonInstrumentedTestObject nonInstrumentedObject = new NonInstrumentedTestObject(); 31 32 private NonInstrumented nonInstrumented = new NonInstrumented(); 33 34 public ReflectionFieldTestApp(String appId, ApplicationConfig cfg, ListenerProvider listenerProvider) { 35 super(appId, cfg, listenerProvider, DataRoot.class); 36 } 37 38 protected Object getTestObject(String testName) { 39 DataRoot root = (DataRoot) sharedMap.get("root"); 40 return root; 41 } 42 43 protected void setupTestObject(String testName) { 44 sharedMap.put("root", new DataRoot(Long.MIN_VALUE)); 45 } 46 47 void testBasicModifyRoot(DataRoot root, boolean validate) { 48 if (validate) { 49 Assert.assertEquals(12, root.getLongValue()); 50 } else { 51 synchronized (root) { 52 root.setLongValue(12); 53 } 54 } 55 } 56 57 void testModifyPhysicalInstrumentedObjectWithStaticManager(DataRoot root, boolean validate) throws Exception { 58 if (validate) { 59 Assert.assertEquals(12, root.getLongValue()); 60 } else { 61 synchronized (root) { 62 Field longValueField = root.getClass().getDeclaredField("longValue"); 63 longValueField.setAccessible(true); 64 longValueField.setLong(root, 12); 65 } 66 } 67 } 68 69 void testModifyPhysicalInstrumentedObjectWithNonStaticManager(DataRoot root, boolean validate) throws Exception { 70 if (validate) { 71 Assert.assertEquals(200, root.getColor().getRGB()); 72 } else { 73 synchronized (root) { 74 Color color = root.getColor(); 75 Field colorField = color.getClass().getDeclaredField("value"); 76 colorField.setAccessible(true); 77 Assert.assertEquals(100, colorField.getInt(color)); 78 colorField.setInt(color, 200); 79 } 80 } 81 } 82 83 void testModifyObjectReference(DataRoot root, boolean validate) throws Exception { 84 if (validate) { 85 Assert.assertEquals(200, root.getColor().getRGB()); 86 } else { 87 synchronized (root) { 88 Field colorField = root.getClass().getDeclaredField("color"); 89 colorField.setAccessible(true); 90 colorField.set(root, new Color (200, true)); 91 } 92 } 93 } 94 95 void testModifyBoolean(DataRoot root, boolean validate) throws Exception { 96 if (validate) { 97 Assert.assertTrue(root.isBooleanValue()); 98 } else { 99 synchronized (root) { 100 Field booleanField = root.getClass().getDeclaredField("booleanValue"); 101 booleanField.setAccessible(true); 102 booleanField.setBoolean(root, true); 103 } 104 } 105 } 106 107 void testModifyByte(DataRoot root, boolean validate) throws Exception { 108 if (validate) { 109 Assert.assertEquals(Byte.MAX_VALUE, root.getByteValue()); 110 } else { 111 synchronized (root) { 112 Field byteField = root.getClass().getDeclaredField("byteValue"); 113 byteField.setAccessible(true); 114 byteField.setByte(root, Byte.MAX_VALUE); 115 } 116 } 117 } 118 119 void testModifyCharacter(DataRoot root, boolean validate) throws Exception { 120 if (validate) { 121 Assert.assertEquals(Character.MAX_VALUE, root.getCharValue()); 122 } else { 123 synchronized (root) { 124 125 Field charField = root.getClass().getDeclaredField("charValue"); 126 charField.setAccessible(true); 127 charField.setChar(root, Character.MAX_VALUE); 128 129 } 130 } 131 } 132 133 void testModifyDoubleWithFloatValue(DataRoot root, boolean validate) throws Exception { 134 if (validate) { 135 Assert.assertEquals(Float.MAX_VALUE, root.getDoubleValue()); 136 } else { 137 synchronized (root) { 138 139 Field doubleField = root.getClass().getDeclaredField("doubleValue"); 140 doubleField.setAccessible(true); 141 doubleField.setFloat(root, Float.MAX_VALUE); 142 } 143 } 144 } 145 146 void testModifyDoubleWithIntValue(DataRoot root, boolean validate) throws Exception { 147 if (validate) { 148 Assert.assertEquals(4, root.getDoubleValue()); 149 } else { 150 synchronized (root) { 151 152 Field doubleField = root.getClass().getDeclaredField("doubleValue"); 153 doubleField.setAccessible(true); 154 doubleField.setInt(root, 4); 155 } 156 } 157 } 158 159 void testModifyDoubleWithLongValue(DataRoot root, boolean validate) throws Exception { 160 if (validate) { 161 Assert.assertEquals(4L, root.getDoubleValue()); 162 } else { 163 synchronized (root) { 164 165 Field doubleField = root.getClass().getDeclaredField("doubleValue"); 166 doubleField.setAccessible(true); 167 doubleField.setLong(root, 4L); 168 } 169 } 170 } 171 172 void testModifyDouble(DataRoot root, boolean validate) throws Exception { 173 if (validate) { 174 Assert.assertEquals(Double.MAX_VALUE, root.getDoubleValue()); 175 } else { 176 synchronized (root) { 177 178 Field doubleField = root.getClass().getDeclaredField("doubleValue"); 179 doubleField.setAccessible(true); 180 doubleField.setDouble(root, Double.MAX_VALUE); 181 } 182 } 183 } 184 185 void testModifyFloat(DataRoot root, boolean validate) throws Exception { 186 if (validate) { 187 Assert.assertEquals(Float.MAX_VALUE, root.getFloatValue()); 188 } else { 189 synchronized (root) { 190 191 Field floatField = root.getClass().getDeclaredField("floatValue"); 192 floatField.setAccessible(true); 193 floatField.setFloat(root, Float.MAX_VALUE); 194 } 195 } 196 } 197 198 void testModifyShort(DataRoot root, boolean validate) throws Exception { 199 if (validate) { 200 Assert.assertEquals(Short.MAX_VALUE, root.getShortValue()); 201 } else { 202 synchronized (root) { 203 204 Field shortField = root.getClass().getDeclaredField("shortValue"); 205 shortField.setAccessible(true); 206 shortField.setShort(root, Short.MAX_VALUE); 207 } 208 } 209 } 210 211 void testModifyIntWithShortValue(DataRoot root, boolean validate) throws Exception { 212 if (validate) { 213 Assert.assertEquals(Short.MAX_VALUE, root.getIntValue()); 214 } else { 215 synchronized (root) { 216 217 Field intField = root.getClass().getDeclaredField("intValue"); 218 intField.setAccessible(true); 219 intField.setInt(root, Short.MAX_VALUE); 220 } 221 } 222 } 223 224 void testModifyIntWithByteValue(DataRoot root, boolean validate) throws Exception { 225 if (validate) { 226 Assert.assertEquals(Byte.MAX_VALUE, root.getIntValue()); 227 } else { 228 synchronized (root) { 229 230 Field intField = root.getClass().getDeclaredField("intValue"); 231 intField.setAccessible(true); 232 intField.setInt(root, Byte.MAX_VALUE); 233 } 234 } 235 } 236 237 void testModifyIntWithCharValue(DataRoot root, boolean validate) throws Exception { 238 if (validate) { 239 Assert.assertEquals(Character.MAX_VALUE, root.getIntValue()); 240 } else { 241 synchronized (root) { 242 243 Field intField = root.getClass().getDeclaredField("intValue"); 244 intField.setAccessible(true); 245 intField.setInt(root, Character.MAX_VALUE); 246 } 247 } 248 } 249 250 void testModifyInt(DataRoot root, boolean validate) throws Exception { 251 if (validate) { 252 Assert.assertEquals(Integer.MAX_VALUE, root.getIntValue()); 253 } else { 254 synchronized (root) { 255 256 Field intField = root.getClass().getDeclaredField("intValue"); 257 intField.setAccessible(true); 258 intField.setInt(root, Integer.MAX_VALUE); 259 } 260 } 261 } 262 263 void testModifyLongWithIntValue(DataRoot root, boolean validate) throws Exception { 264 if (validate) { 265 Assert.assertEquals(Integer.MAX_VALUE, root.getLongValue()); 266 } else { 267 synchronized (root) { 268 269 Field longField = root.getClass().getDeclaredField("longValue"); 270 longField.setAccessible(true); 271 longField.setInt(root, Integer.MAX_VALUE); 272 } 273 } 274 } 275 276 void testModifyLongWithShortValue(DataRoot root, boolean validate) throws Exception { 277 if (validate) { 278 Assert.assertEquals(Short.MAX_VALUE, root.getLongValue()); 279 } else { 280 synchronized (root) { 281 282 Field longField = root.getClass().getDeclaredField("longValue"); 283 longField.setAccessible(true); 284 longField.setShort(root, Short.MAX_VALUE); 285 } 286 } 287 } 288 289 void testModifyLongWithByteValue(DataRoot root, boolean validate) throws Exception { 290 if (validate) { 291 Assert.assertEquals(Byte.MAX_VALUE, root.getLongValue()); 292 } else { 293 synchronized (root) { 294 295 Field longField = root.getClass().getDeclaredField("longValue"); 296 longField.setAccessible(true); 297 longField.setByte(root, Byte.MAX_VALUE); 298 } 299 } 300 } 301 302 void testModifyLongWithCharValue(DataRoot root, boolean validate) throws Exception { 303 if (validate) { 304 Assert.assertEquals(Character.MAX_VALUE, root.getLongValue()); 305 } else { 306 synchronized (root) { 307 308 Field longField = root.getClass().getDeclaredField("longValue"); 309 longField.setAccessible(true); 310 longField.setChar(root, Character.MAX_VALUE); 311 } 312 } 313 } 314 315 void testModifyLongWithFloatValue(DataRoot root, boolean validate) throws Exception { 316 if (validate) { 317 Assert.assertEquals(Long.MIN_VALUE, root.getLongValue()); 318 } else { 319 synchronized (root) { 320 try { 321 Field longField = root.getClass().getDeclaredField("longValue"); 322 longField.setAccessible(true); 323 longField.setFloat(root, Float.MAX_VALUE); 324 throw new AssertionError ("should have thrown an exception"); 325 } catch (IllegalArgumentException re) { 326 } 328 } 329 } 330 } 331 332 void testModifyLongWithDoubleValue(DataRoot root, boolean validate) throws Exception { 333 if (validate) { 334 Assert.assertEquals(Long.MIN_VALUE, root.getLongValue()); 335 } else { 336 synchronized (root) { 337 try { 338 Field longField = root.getClass().getDeclaredField("longValue"); 339 longField.setAccessible(true); 340 longField.setDouble(root, Double.MAX_VALUE); 341 throw new AssertionError ("should have thrown an exception"); 342 } catch (IllegalArgumentException re) { 343 } 345 } 346 } 347 } 348 349 void testModifyLong(DataRoot root, boolean validate) throws Exception { 350 if (validate) { 351 Assert.assertEquals(Long.MAX_VALUE, root.getLongValue()); 352 } else { 353 synchronized (root) { 354 Field longField = root.getClass().getDeclaredField("longValue"); 355 longField.setAccessible(true); 356 longField.setLong(root, Long.MAX_VALUE); 357 } 358 } 359 } 360 361 void testModifyNonSharedTCManagedField(DataRoot root, boolean validate) throws Exception { 362 Field tcManaged = nonShared.getClass().getDeclaredField(ClassAdapterBase.MANAGED_FIELD_NAME); 363 tcManaged.setAccessible(true); 364 if (validate) { 365 Object tcManagedObject = tcManaged.get(nonShared); 366 Assert.assertNull(tcManagedObject); 367 Assert.assertNull(((Manageable) nonShared).__tc_managed()); 368 } else { 369 Assert.assertNotNull(((Manageable) root).__tc_managed()); 370 Assert.assertNull(((Manageable) nonShared).__tc_managed()); 371 tcManaged.set(nonShared, ((Manageable) root).__tc_managed()); 372 Assert.assertNull(((Manageable) nonShared).__tc_managed()); 373 } 374 } 375 376 void testModifySharedTCManagedField(DataRoot root, boolean validate) throws Exception { 377 Field tcManaged = root.getClass().getDeclaredField(ClassAdapterBase.MANAGED_FIELD_NAME); 378 tcManaged.setAccessible(true); 379 if (validate) { 380 Object tcManagedObject = tcManaged.get(root); 381 Assert.assertNull(tcManagedObject); 382 Assert.assertNotNull(((Manageable) root).__tc_managed()); 383 } else { 384 Assert.assertNotNull(((Manageable) root).__tc_managed()); 385 tcManaged.set(root, null); 386 Assert.assertNotNull(((Manageable) root).__tc_managed()); 387 } 388 } 389 390 void testModifyAndGetLiteralRoot(DataRoot root, boolean validate) throws Exception { 391 Field literalRootField = getClass().getDeclaredField("literalRoot"); 392 literalRootField.setAccessible(true); 393 394 Field primitiveRootField = getClass().getDeclaredField("primitiveRoot"); 395 primitiveRootField.setAccessible(true); 396 397 if (validate) { 398 Integer localLiteralRoot = (Integer ) literalRootField.get(this); 399 Assert.assertNotNull(localLiteralRoot); 400 Assert.assertEquals(new Integer (100), localLiteralRoot); 401 402 Integer localPrimitiveRoot = (Integer ) primitiveRootField.get(this); 403 Assert.assertNotNull(localPrimitiveRoot); 404 Assert.assertEquals(new Integer (200), localPrimitiveRoot); 405 } else { 406 Object value = literalRootField.get(this); 407 Assert.assertNull(value); 408 409 literalRootField.set(this, new Integer (100)); 411 412 value = primitiveRootField.get(this); 413 Assert.assertEquals(new Integer (0), value); 414 primitiveRootField.set(this, new Integer (200)); 415 } 416 } 417 418 void testModifyAndGetRoot(DataRoot root, boolean validate) throws Exception { 419 Field rootField = getClass().getDeclaredField("reflectionRoot"); 420 rootField.setAccessible(true); 421 422 if (validate) { 423 DataRoot dataRoot = (DataRoot) rootField.get(this); 424 Assert.assertNotNull(dataRoot); 425 Assert.assertEquals(200, dataRoot.getLongValue()); 426 Assert.assertEquals(200, reflectionRoot.getLongValue()); 427 } else { 428 Object value = rootField.get(this); 429 Assert.assertNull(value); 430 431 rootField.set(this, new DataRoot(200)); 433 } 434 } 435 436 void testModifyNonSharedObject(DataRoot root, boolean validate) throws Exception { 437 if (!validate) { 438 synchronized (nonShared) { 439 440 Field longValueField = nonShared.getClass().getDeclaredField("longValue"); 441 longValueField.setAccessible(true); 442 longValueField.setLong(nonShared, Long.MAX_VALUE); 443 } 444 Assert.assertEquals(Long.MAX_VALUE, nonShared.getLongValue()); 445 } 446 } 447 448 void testModifyNonInstrumentedObject(DataRoot root, boolean validate) throws Exception { 449 if (!validate) { 450 synchronized (nonInstrumentedObject) { 451 Field longValueField = nonInstrumentedObject.getClass().getDeclaredField("longValue"); 452 longValueField.setAccessible(true); 453 longValueField.setLong(nonInstrumentedObject, Long.MAX_VALUE); 454 } 455 Assert.assertEquals(Long.MAX_VALUE, nonInstrumentedObject.getLongValue()); 456 } 457 } 458 459 void testModifyLogicalInstrumentedObject(DataRoot root, boolean validate) throws Exception { 460 if (validate) { 461 Assert.assertEquals(0, root.getList().size()); 462 } else { 463 synchronized (root) { 464 List list = root.getList(); 465 try { 466 Field sizeField = list.getClass().getDeclaredField("size"); 467 sizeField.setAccessible(true); 468 sizeField.setInt(list, 10); 469 throw new AssertionError ("should have thrown an exception"); 470 } catch (IllegalAccessException re) { 471 Assert.assertEquals("Field modification through reflection for non-physical shared object of type " 475 + list.getClass().getName() + " is not supported!", re.getMessage()); 476 } 477 } 478 479 } 480 } 481 482 void testModifyNonInstrumentedObjectRoot(DataRoot root, boolean validate) throws Exception { 483 Field nonInstrumentedRootField = nonInstrumented.getClass().getDeclaredField("nonInstrumentedRoot"); 484 nonInstrumentedRootField.setAccessible(true); 485 if (validate) { 486 Assert.assertEquals(root, nonInstrumented.getNonInstrumentedRoot()); 487 488 Object nonInstrumentedRoot = nonInstrumentedRootField.get(nonInstrumented); 489 Assert.assertEquals(root, nonInstrumentedRoot); 490 } else { 491 nonInstrumentedRootField.set(nonInstrumented, root); 492 } 493 } 494 495 void testGetObjectReference(DataRoot root, boolean validate) throws Exception { 496 if (validate) { 497 Field colorField = root.getClass().getDeclaredField("color"); 498 colorField.setAccessible(true); 499 Object color = colorField.get(root); 500 Assert.assertNotNull(color); 501 Assert.assertEquals(new Color (100, true), color); 502 } 503 } 504 505 void testLogicalClasses(DataRoot root, boolean validate) throws Exception { 506 Map map = root.getMap(); 507 Map subMap = root.getSubMap(); 508 509 Field sizeField = HashMap .class.getDeclaredField("size"); 510 Field iField = subMap.getClass().getDeclaredField("i"); 511 sizeField.setAccessible(true); 512 iField.setAccessible(true); 513 514 if (validate) { 515 int size = sizeField.getInt(map); 516 Assert.assertEquals(1, size); 517 size = ((Integer ) sizeField.get(subMap)).intValue(); 518 519 int i = iField.getInt(subMap); 520 Assert.assertEquals(5, i); 521 522 } else { 523 int i = iField.getInt(subMap); 524 Assert.assertEquals(3, i); 525 526 synchronized (subMap) { 527 iField.setInt(subMap, 5); 528 } 529 } 530 531 } 532 533 537 void testModifyNonRootStaticField(DataRoot root, boolean validate) throws Exception { 538 Field staticLongField = root.getClass().getDeclaredField("staticLong"); 539 staticLongField.setAccessible(true); 540 if (!validate) { 541 staticLongField.set(null, new Long (33L)); 542 Assert.assertEquals(new Long (33L), DataRoot.getStaticLong()); 543 544 Object staticLongFieldValue = staticLongField.get(null); 545 Assert.assertEquals(new Long (33L), staticLongFieldValue); 546 547 staticLongField.set(null, new Long (50L)); 548 Assert.assertEquals(new Long (50L), DataRoot.getStaticLong()); 549 550 staticLongFieldValue = staticLongField.get(null); 551 Assert.assertEquals(new Long (50L), staticLongFieldValue); 552 } 553 } 554 555 void testModifyRootStaticField(DataRoot root, boolean validate) throws Exception { 556 Field nonInstrumentedStaticRootField = nonInstrumented.getClass().getDeclaredField("nonInstrumentedStaticRoot"); 557 nonInstrumentedStaticRootField.setAccessible(true); 558 if (validate) { 559 Assert.assertEquals(root, NonInstrumented.getNonInstrumentedStaticRoot()); 560 561 Object nonInstrumentedStaticRootValue = nonInstrumentedStaticRootField.get(null); 562 Assert.assertEquals(root, nonInstrumentedStaticRootValue); 563 } else { 564 nonInstrumentedStaticRootField.set(null, root); 565 } 566 } 567 568 void testReadOnlyModifyLong(DataRoot root, boolean validate) throws Exception { 570 if (validate) { 571 Assert.assertEquals(Long.MIN_VALUE, root.getLongValue()); 572 } else { 573 synchronized (root) { 574 try { 575 Field longField = root.getClass().getDeclaredField("longValue"); 576 longField.setAccessible(true); 577 longField.setLong(root, Long.MAX_VALUE); 578 throw new AssertionError ("I should have thrown a ReadOnlyException."); 579 } catch (ReadOnlyException t) { 580 } 582 } 583 } 584 } 585 586 public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) { 587 String testClass = ReflectionFieldTestApp.class.getName(); 588 config.getOrCreateSpec(testClass); 589 590 config.getOrCreateSpec(SubMap.class.getName()); 591 592 String writeAllowedMethodExpression = "* " + testClass + "*.*(..)"; 593 config.addWriteAutolock(writeAllowedMethodExpression); 594 String readOnlyMethodExpression = "* " + testClass + "*.*ReadOnly*(..)"; 595 config.addReadAutolock(readOnlyMethodExpression); 596 597 config.addRoot(testClass, "reflectionRoot", "reflectionRoot", true); 598 config.addRoot(testClass, "literalRoot", "literalRoot", true); 599 config.addRoot(testClass, "primitiveRoot", "primitiveRoot", true); 600 config.addIncludePattern(DataRoot.class.getName()); 601 602 config.addRoot(NonInstrumented.class.getName(), "nonInstrumentedRoot", "nonInstrumentedRoot", false); 603 config.addRoot(NonInstrumented.class.getName(), "nonInstrumentedStaticRoot", "nonInstrumentedStaticRoot", false); 604 } 605 606 protected void silenceCompilerWarnings() { 607 if (false && literalRoot != literalRoot && primitiveRoot != primitiveRoot) { 608 throw new AssertionError ("Don't call this method"); 610 } 611 } 612 613 private static class NonInstrumented extends NonInstrumentedTestObject { 614 private static DataRoot nonInstrumentedStaticRoot; 615 616 private DataRoot nonInstrumentedRoot; 617 618 public NonInstrumented() { 619 super(); 620 } 621 622 public static DataRoot getNonInstrumentedStaticRoot() { 623 return nonInstrumentedStaticRoot; 624 } 625 626 public static void setNonInstrumentedStaticRoot(DataRoot nonInstrumentedStaticRoot) { 627 NonInstrumented.nonInstrumentedStaticRoot = nonInstrumentedStaticRoot; 628 } 629 630 public DataRoot getNonInstrumentedRoot() { 631 return nonInstrumentedRoot; 632 } 633 634 public void setNonInstrumentedRoot(DataRoot nonInstrumentedRoot) { 635 this.nonInstrumentedRoot = nonInstrumentedRoot; 636 } 637 } 638 639 private static class SubMap extends HashMap { 640 private int i = 3; 641 642 public SubMap() { 643 put("key", "value"); 644 if (i == 5) { throw new RuntimeException (); 646 } 647 } 648 } 649 650 private static class DataRoot { 651 private static Long staticLong; 652 653 private ArrayList list = new ArrayList (); 654 private Color color = new Color (100, true); 655 private long longValue = Long.MIN_VALUE; 656 private int intValue = Integer.MIN_VALUE; 657 private short shortValue = Short.MIN_VALUE; 658 private boolean booleanValue = false; 659 private byte byteValue = Byte.MIN_VALUE; 660 private char charValue = Character.MIN_VALUE; 661 private double doubleValue = Double.MIN_VALUE; 662 private float floatValue = Float.MIN_VALUE; 663 664 private final Map map = new HashMap (); 665 { 666 map.put("key", "value"); 667 } 668 669 private final Map subMap = new SubMap(); 670 671 public DataRoot(long longValue) { 672 this.longValue = longValue; 673 } 674 675 public DataRoot() { 676 } 678 679 public Map getSubMap() { 680 return subMap; 681 } 682 683 public Map getMap() { 684 return map; 685 } 686 687 public static Long getStaticLong() { 688 return staticLong; 689 } 690 691 public static void setStaticLong(Long staticLong) { 692 DataRoot.staticLong = staticLong; 693 } 694 695 protected ArrayList getList() { 696 return list; 697 } 698 699 protected void setList(ArrayList list) { 700 this.list = list; 701 } 702 703 protected Color getColor() { 704 return color; 705 } 706 707 protected void setColor(Color color) { 708 this.color = color; 709 } 710 711 protected long getLongValue() { 712 return longValue; 713 } 714 715 protected void setLongValue(long longValue) { 716 this.longValue = longValue; 717 } 718 719 protected int getIntValue() { 720 return intValue; 721 } 722 723 protected void setIntValue(int intValue) { 724 this.intValue = intValue; 725 } 726 727 protected boolean isBooleanValue() { 728 return booleanValue; 729 } 730 731 protected void setBooleanValue(boolean booleanValue) { 732 this.booleanValue = booleanValue; 733 } 734 735 protected byte getByteValue() { 736 return byteValue; 737 } 738 739 protected void setByteValue(byte byteValue) { 740 this.byteValue = byteValue; 741 } 742 743 protected char getCharValue() { 744 return charValue; 745 } 746 747 protected void setCharValue(char charValue) { 748 this.charValue = charValue; 749 } 750 751 protected double getDoubleValue() { 752 return doubleValue; 753 } 754 755 protected void setDoubleValue(double doubleValue) { 756 this.doubleValue = doubleValue; 757 } 758 759 protected float getFloatValue() { 760 return floatValue; 761 } 762 763 protected void setFloatValue(float floatValue) { 764 this.floatValue = floatValue; 765 } 766 767 protected short getShortValue() { 768 return shortValue; 769 } 770 771 protected void setShortValue(short shortValue) { 772 this.shortValue = shortValue; 773 } 774 } 775 } 776
| Popular Tags
|