- Timestamp:
- 01/09/14 11:50:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/AttributeUtils.java
r656 r671 340 340 ensureReady(); 341 341 342 AttributeSet a s= null;342 AttributeSet attribSet = null; 343 343 if(toExtract instanceof Frame) { 344 a s= _FrameAttrib;344 attribSet = _FrameAttrib; 345 345 } else if(toExtract instanceof Item) { 346 a s= _Attrib;346 attribSet = _Attrib; 347 347 } else { 348 348 throw new IncorrectTypeException("toExtract", "Item | Frame"); … … 353 353 354 354 // iterate through the list of methods 355 for (String prop : a s.keys) {356 357 Attribute a = a s.get(prop);355 for (String prop : attribSet.keys) { 356 357 Attribute a = attribSet.get(prop); 358 358 // Make sure the classes of the methods match the item 359 359 if (a != null && a.getter != null && a.getter.getDeclaringClass().isAssignableFrom(toExtract.getClass())) { … … 527 527 528 528 ensureReady(); 529 530 AttributeSet attribSet = null; 531 if(toSet instanceof Frame) { 532 attribSet = _FrameAttrib; 533 } else if(toSet instanceof Item) { 534 attribSet = _Attrib; 535 } else { 536 throw new IncorrectTypeException("toExtract", "Item | Frame"); 537 } 529 538 530 539 // if(attribs.isAnnotation()) … … 585 594 return false; 586 595 } else { 587 Attribute a = _Attrib.get(stripped);596 Attribute a = attribSet.get(stripped); 588 597 if(a == null || a.setter == null) { 589 598 return false; … … 628 637 String value = avp.getValue(); 629 638 assert (value != null); 639 640 AttributeSet attribSet = null; 641 if(toSet instanceof Frame) { 642 attribSet = _FrameAttrib; 643 } else if(toSet instanceof Item) { 644 attribSet = _Attrib; 645 } else { 646 throw new IncorrectTypeException("toExtract", "Item | Frame"); 647 } 630 648 631 649 // Some properties are ignored when multiple attributes are being set on … … 638 656 // Separate multiple values if required 639 657 640 Attribute a = _Attrib.get(attribute);658 Attribute a = attribSet.get(attribute); 641 659 // if this is not the name of a method, it may be the name of an agent 642 660 if (a == null || a.setter == null) { … … 650 668 possibles.add(a.setter); 651 669 int i = 0; 652 while ( _Attrib.containsKey(attribute + i)) {653 Method m = _Attrib.get(attribute + i).setter;670 while (attribSet.containsKey(attribute + i)) { 671 Method m = attribSet.get(attribute + i).setter; 654 672 if(m == null) { 655 673 break; … … 699 717 private static Object invokeAttributeGetMethod(String name, Object toSet) { 700 718 701 Attribute a = _Attrib.get(name.toLowerCase()); 719 AttributeSet attribSet = null; 720 if(toSet instanceof Frame) { 721 attribSet = _FrameAttrib; 722 } else if(toSet instanceof Item) { 723 attribSet = _Attrib; 724 } else { 725 throw new IncorrectTypeException("toExtract", "Item | Frame"); 726 } 727 728 Attribute a = attribSet.get(name.toLowerCase()); 702 729 if(a == null) { 703 730 return null;
Note:
See TracChangeset
for help on using the changeset viewer.