eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'WrappedMethod':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: WrappedMethod


Inheritance:

   Object
   |
   +--ExecutableFunction
      |
      +--CompiledCode
         |
         +--Method
            |
            +--WrappedMethod

Package:
stx:libbasic3
Category:
Kernel-Methods
Version:
rev: 1.50 date: 2019/07/09 18:08:40
user: cg
file: WrappedMethod.st directory: libbasic3
module: stx stc-classLibrary: libbasic3
Author:
Claus Gittinger

Description:


support for MessageTracer

notice: remembers wrappers in a weak classvar, because finding the wrapper for a
method is required for single stepping, and used to take a long time when using allInstances.
Therefore, wrappers are remembered.


Related information:

    MessageTracer

Class protocol:

registration
o  allInstancesDo: aBlock

o  allWrappedMethods
must double check - as this is a weak set, it gets cleaned up with a delay.

usage example(s):

     self allWrappedMethods

o  allWrappedMethodsDo: aBlock

o  register: aWrappedMethod

o  unregister: aWrappedMethod


Instance protocol:

accessing
o  basicLiterals
return my literals

o  category: newCategory

o  literals
return the wrapped method's literals

o  literalsDetect: aBlock ifNone: exceptionBlock
access the wrapped method's literals

o  literalsDo: aBlock
access the wrapped method's literals

o  methodArgAndVarNames
return the names of the args and locals of the wrapped method.

o  methodArgAndVarNamesInContext: context
return the names of the args and locals of the wrapped method.
in given context (for Java, as in java local names differ by
actual program counter)

o  methodVarNames
return the names of the locals of the wrapped method.

o  numVars
return the number of locals in the wrapped method.

o  originalMethod
return the method the receiver is wrapping

o  originalMethodIfWrapped
return the method the receiver is wrapping

o  package: aSymbol

o  privacy
return the wrapped method's privacy

o  privacy: aSymbol
set the wrapped method's privacy

o  programmingLanguage
(comment from inherited method)
the following is correct, but might be too slow...

o  replaceOriginalMethodWith: aNewMethod
change the original method which is going to be invoked by this wrapper.
The only place where this makes sense is when the original method has to be
replaced by a recompiled breakpointed method (in the debugger).

o  restricted: aBoolean

o  setPrivacy: aSymbol
set the wrapped method's privacy

o  shadowedMethod
return true, if this method is an extension (i.e. package ~= classes' package)
which shadows an existing method from another package (i.e. a package conflict)

o  source
return the source of the method

o  sourceFilename
return the sourcefilename if source is extern; nil otherwise

o  sourcePosition
return the sourceposition if source is extern; nil otherwise

accessing-annotations
o  annotateWith: annotation
add a (hidden) annotation

o  annotationAt: key
(comment from inherited method)
(Object >> #yourself) annotationAt: #namespace:

o  annotations
return the wrapped method's annotations

o  annotations: anObject
(comment from inherited method)
set the annotations

o  annotationsAt: key

o  annotationsAt: key1 orAt: key2

o  annotationsAt: key1 orAt: key2 do: block

o  annotationsDo: aBlock

misc
o  makeLocalStringSource
(comment from inherited method)
assure that the method's source code is stored locally as a string
within the method (as opposed to an external string, which is accessed
by reading the source code file).
This is required, when a method's package is changed, to assure that its
sourceCode is not lost.

o  register

o  unregister

printing & storing
o  printOn: aStream
put a printed representation of the receiver onto aStream.
Since methods do not store their class/selector, we have to search
for it here.

o  selectorPrintStringInBrowserFor: selector

o  selectorPrintStringInBrowserFor: selector class: class
(comment from inherited method)
nsPart := selector copyFrom:2 to:idx-1.
ns := Smalltalk at:nsPart asSymbol.

private
o  annotationAtIndex: index
return annotation at given index.
any raw annotation array is lazily initialized

o  annotationIndexOf: key
Returns index of annotation with given key
or nil if there is no such annotation

queries
o  argSignature

o  hasAnnotation
Return true iff the method has any annotation

o  hasResource
return the wrapped methods hasResource

o  isBreakpointed
return true, if the receiver is a wrapped method for a breakpoint.
Ask the messageTracer, since I don't know if it's a break or trace

o  isMocked
Return true, if the method has been mocked (by means of MessageTracer>>mockMethod:do:

o  isTimed
return true, if the receiver is a wrapped method for a time measurement.
Ask the messageTracer, since I don't know if it's a break or trace

o  isTraced
return true, if the receiver is a wrapped method for a trace point.
Ask the messageTracer, since I don't know if it's a break or trace

o  isWrapped
return true, if the receiver is a wrapped method.
True is returned here, since the receiver is always a wrapped one

o  messagesSent
return a set-like collection with the message selectors sent by the receiver.
Uses Parser to parse methods source and extract the names.
The returned collection includes all used message selectors
(i.e. including super-send messages)

o  messagesSentToSelf
return a collection of message selectors sent to self by this method

o  messagesSentToSuper
return a collection of message selectors sent to super by this method

o  parse: parseSelector with: arg2 return: accessSelector or: valueIfNoSource
(comment from inherited method)
helper for methodArgNames, methodVarNames etc.
Get the source, let parser parse it using parseSelector,
return parser-info using accessSelector

o  refersToLiteral: anObject

o  resources
return the wrapped methods resources

o  signature

o  signatureNameWithoutReturnType



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 10:03:50 GMT