JavaClass.st
branchcvs_MAIN
changeset 3412 df11bb428463
parent 3377 71c37cd3b94b
parent 3381 cd0cdb3628f9
child 3427 9f7e8a7548fc
equal deleted inserted replaced
3386:ddcff50a1fdc 3412:df11bb428463
   933     "Created: / 13-08-2011 / 00:30:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   933     "Created: / 13-08-2011 / 00:30:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   934     "Modified: / 07-12-2014 / 01:39:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   934     "Modified: / 07-12-2014 / 01:39:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   935 !
   935 !
   936 
   936 
   937 source
   937 source
   938     "Returns a source of the class as String or nil of no source is found along the Java's source paths."
       
   939     | sourceString stream |
   938     | sourceString stream |
   940     (sourceString := self sourceString) notNil ifTrue: [ ^ sourceString ].
   939     (sourceString := self sourceString) notNil ifTrue: [ ^ sourceString ].
   941     ^ [
   940     ^ [
   942         stream := self sourceStream.
   941         stream := self sourceStream.
   943         stream notNil ifTrue:[
   942         stream notNil ifTrue:[
   955      (Java at:'ArcCanvas') source
   954      (Java at:'ArcCanvas') source
   956     "
   955     "
   957 
   956 
   958     "Modified: / 30-07-1997 / 14:31:01 / cg"
   957     "Modified: / 30-07-1997 / 14:31:01 / cg"
   959     "Modified: / 07-12-2014 / 01:32:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   958     "Modified: / 07-12-2014 / 01:32:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   960     "Modified (comment): / 17-02-2015 / 13:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   961 !
       
   962 
       
   963 sourceDecompiled
       
   964     "Returns a decompiled source code as String."
       
   965 
       
   966     | resources | 
       
   967 
       
   968     resources := self classResources.
       
   969 
       
   970     ^ String streamContents:[:s |
       
   971         s nextPutAll: '/**'; cr.
       
   972         s nextPutAll: ' * ' ; nextPutAll: (resources string: 'No source has been found along configured source path:'); cr.
       
   973         s nextPutAll: ' * ' ; cr.
       
   974         Java effectiveSourceDirectories do:[:d | 
       
   975             s nextPutAll: ' *     '; nextPutAll: d asString; cr.
       
   976         ].
       
   977         s nextPutAll: ' * ' ; cr.
       
   978         s nextPutAll: ' * ' ; nextPutAll: (resources string: 'You may add more source directories or archives by evaluating:'); cr.
       
   979         s nextPutAll: ' * ' ; cr.
       
   980         s nextPutAll: ' *     '; nextPutAll: 'Java addToSourceDirectories: ''/path/to/sources''.' ; cr.
       
   981         s nextPutAll: ' */'; cr.                                                                       
       
   982         JavaDecompiler definitionOf:self on:s
       
   983     ]
       
   984     "
       
   985     JAVA java lang Object sourceDecompiled
       
   986     "
       
   987 
       
   988     "Created: / 17-02-2015 / 12:07:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   989 !
   959 !
   990 
   960 
   991 sourceFile
   961 sourceFile
   992     ^ classFilename
   962     ^ classFilename
   993 
   963 
  3543 ! !
  3513 ! !
  3544 
  3514 
  3545 !JavaClass class methodsFor:'documentation'!
  3515 !JavaClass class methodsFor:'documentation'!
  3546 
  3516 
  3547 version
  3517 version
  3548     ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.139 2015-02-17 15:16:50 vrany Exp $'
  3518     ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.140 2015-03-20 12:07:59 vrany Exp $'
  3549 !
  3519 !
  3550 
  3520 
  3551 version_CVS
  3521 version_CVS
  3552     ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.139 2015-02-17 15:16:50 vrany Exp $'
  3522     ^ '$Header: /cvs/stx/stx/libjava/JavaClass.st,v 1.140 2015-03-20 12:07:59 vrany Exp $'
  3553 !
  3523 !
  3554 
  3524 
  3555 version_SVN
  3525 version_SVN
  3556     ^ 'Id'
  3526     ^ 'Id'
  3557 ! !
  3527 ! !