401 ] |
401 ] |
402 |
402 |
403 "Modified: / 13-06-2012 / 13:01:58 / cg" |
403 "Modified: / 13-06-2012 / 13:01:58 / cg" |
404 ! |
404 ! |
405 |
405 |
|
406 definitionStringInNamespace: ns |
|
407 | classNameUsed superClassNameUsed | |
|
408 |
|
409 objectType == #variable ifTrue:[ |
|
410 ^ String streamContents:[:stream | |
|
411 ns notNil ifTrue:[ |
|
412 stream |
|
413 nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
|
414 ] ifFalse:[ |
|
415 self halt:'can this happen ?'. |
|
416 stream |
|
417 nextPutAll:'Smalltalk' |
|
418 ]. |
|
419 |
|
420 stream |
|
421 nextPutAll:' addClassVarName:'; |
|
422 nextPutAll:className asString storeString |
|
423 ]. |
|
424 ]. |
|
425 |
|
426 superClassNameUsed := self superClassName. |
|
427 classNameUsed := self classNameWithoutNamespace. |
|
428 |
|
429 ^ String streamContents:[:stream | |
|
430 self isPrivateClassDefinitionChange ifFalse:[ |
|
431 stream |
|
432 nextPutAll:superClassNameUsed; |
|
433 nextPutAll:' subclass:'; |
|
434 nextPutAll: classNameUsed asSymbol storeString |
|
435 ; |
|
436 cr; |
|
437 tab; |
|
438 nextPutAll:'instanceVariableNames:'; |
|
439 nextPutAll:(instanceVariableNames ? '') storeString; |
|
440 cr; |
|
441 tab; |
|
442 nextPutAll:'classVariableNames:'; |
|
443 nextPutAll:(classVariableNames ? '') storeString; |
|
444 cr; |
|
445 tab; |
|
446 nextPutAll:'poolDictionaries:'; |
|
447 nextPutAll:(poolDictionaries ? '') storeString; |
|
448 cr; |
|
449 tab; |
|
450 nextPutAll:'category:'; |
|
451 nextPutAll:(category ? '') storeString; |
|
452 cr |
|
453 ] ifTrue:[ |
|
454 stream |
|
455 nextPutAll:superClassNameUsed; |
|
456 nextPutAll:' subclass:'; |
|
457 nextPutAll: (self className copyFrom: owningClassName size + 3) asSymbol storeString |
|
458 ; |
|
459 cr; |
|
460 tab; |
|
461 nextPutAll:'instanceVariableNames:'; |
|
462 nextPutAll:(instanceVariableNames ? '') storeString; |
|
463 cr; |
|
464 tab; |
|
465 nextPutAll:'classVariableNames:'; |
|
466 nextPutAll:(classVariableNames ? '') storeString; |
|
467 cr; |
|
468 tab; |
|
469 nextPutAll:'poolDictionaries:'; |
|
470 nextPutAll:(poolDictionaries ? '') storeString; |
|
471 cr; |
|
472 tab; |
|
473 nextPutAll:'privateIn:'; |
|
474 nextPutAll: |
|
475 (ns isNil |
|
476 ifTrue:[owningClassName] |
|
477 ifFalse:[owningClassName copyFrom: ns size + 3]); |
|
478 cr |
|
479 ] |
|
480 ] |
|
481 |
|
482 "Modified: / 06-10-2011 / 17:02:05 / cg" |
|
483 "Created: / 20-03-2012 / 19:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
484 ! |
|
485 |
|
486 definitionStringWithoutNamespace |
|
487 |ns classNameUsed superClassNameUsed| |
|
488 |
|
489 ns := self nameSpaceOverride. |
|
490 |
|
491 objectType == #variable ifTrue:[ |
|
492 ^ String streamContents:[:stream | |
|
493 ns notNil ifTrue:[ |
|
494 stream |
|
495 nextPutAll:((ns asCollectionOfSubstringsSeparatedBy:$.) asStringWith:'::') |
|
496 ] ifFalse:[ |
|
497 self halt:'can this happen ?'. |
|
498 stream |
|
499 nextPutAll:'Smalltalk' |
|
500 ]. |
|
501 |
|
502 stream |
|
503 nextPutAll:' addClassVarName:'; |
|
504 nextPutAll:className asString storeString |
|
505 ]. |
|
506 ]. |
|
507 |
|
508 superClassNameUsed := self superClassName. |
|
509 classNameUsed := self classNameWithoutNamespace. |
|
510 |
|
511 ^ String streamContents:[:stream | |
|
512 self isPrivateClassDefinitionChange ifFalse:[ |
|
513 stream |
|
514 nextPutAll:superClassNameUsed; |
|
515 nextPutAll:' subclass:'; |
|
516 nextPutAll: classNameUsed asSymbol storeString |
|
517 ; |
|
518 cr; |
|
519 tab; |
|
520 nextPutAll:'instanceVariableNames:'; |
|
521 nextPutAll:(instanceVariableNames ? '') storeString; |
|
522 cr; |
|
523 tab; |
|
524 nextPutAll:'classVariableNames:'; |
|
525 nextPutAll:(classVariableNames ? '') storeString; |
|
526 cr; |
|
527 tab; |
|
528 nextPutAll:'poolDictionaries:'; |
|
529 nextPutAll:(poolDictionaries ? '') storeString; |
|
530 cr; |
|
531 tab; |
|
532 nextPutAll:'category:'; |
|
533 nextPutAll:(category ? '') storeString; |
|
534 cr |
|
535 ] ifTrue:[ |
|
536 stream |
|
537 nextPutAll:superClassNameUsed; |
|
538 nextPutAll:' subclass:'; |
|
539 nextPutAll: (self className copyFrom: owningClassName size + 3) asSymbol storeString |
|
540 ; |
|
541 cr; |
|
542 tab; |
|
543 nextPutAll:'instanceVariableNames:'; |
|
544 nextPutAll:(instanceVariableNames ? '') storeString; |
|
545 cr; |
|
546 tab; |
|
547 nextPutAll:'classVariableNames:'; |
|
548 nextPutAll:(classVariableNames ? '') storeString; |
|
549 cr; |
|
550 tab; |
|
551 nextPutAll:'poolDictionaries:'; |
|
552 nextPutAll:(poolDictionaries ? '') storeString; |
|
553 cr; |
|
554 tab; |
|
555 nextPutAll:'privateIn:'; |
|
556 nextPutAll: |
|
557 ((ns := self nameSpaceName) isNil |
|
558 ifTrue:[owningClassName] |
|
559 ifFalse:[owningClassName copyFrom: ns size + 3]); |
|
560 cr |
|
561 ] |
|
562 ] |
|
563 |
|
564 "Modified: / 06-10-2011 / 17:02:05 / cg" |
|
565 "Created: / 20-03-2012 / 16:37:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
566 ! |
|
567 |
406 printOn:aStream |
568 printOn:aStream |
407 aStream |
569 aStream |
408 nextPutAll:className; nextPutAll:' {definition}' |
570 nextPutAll:className; nextPutAll:' {definition}' |
409 |
571 |
410 "Modified: / 12-10-2006 / 17:48:28 / cg" |
572 "Modified: / 12-10-2006 / 17:48:28 / cg" |