|
|
Class: Class
Object
|
+--Behavior
|
+--ClassDescription
|
+--Class
|
+--JavaScriptClass
|
+--SmalltalkShareClient::RemoteClass
- Package:
- stx:libbasic
- Category:
- Kernel-Classes
- Version:
- rev:
1.573
date: 2010/04/30 09:56:51
- user: stefan
- file: Class.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
Class adds more functionality to classes; minimum stuff has already
been defined in Behavior and ClassDescription; this adds naming, categories etc.
[Instance variables:]
name <Symbol> the classes name
category <Symbol> the classes category
classvars <String> the names of the class variables;
| <Collection of words> initially, stc generates a string; this is converted on the fly
to an array of names. In the future, stc may be changed.
comment <String> the classes comment; either a string,
a number specifying the offset in classFilename, or nil
subclasses <Collection> cached collection of subclasses
(not used for execution, but for the IDE to speed up certain operations)
classFilename <String> the file (or nil) where the classes' sources are found
package <Symbol> the package, in which the class was defined (inserted by compilers)
revision <String> revision string - inserted by stc
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace)
signature <SmallInteger> the classes signature (used to detect obsolete or changed classes with binaryStorage)
This is filled in lazy - i.e. upon the first signature query.
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc.
also a place to add additional attributes, without a need to recompile all classes.
WARNING: layout known by compiler and runtime system
Behavior
ClassDescription
Metaclass
accessing-flags
-
tryLocalSourceFirst
-
if true, local source files are tried first, before a sourceCodemanager is
consulted. This may speed up the source access, but adds some insecurity, because
the sourceCodemanager is always getting the source for the classes correct version.
In contrast, the local file might be different from (edited in an external tool) in
the meantime. You have been warned - better leave it false (the sourceCodemanager will
fill its cache and eventually be just as fast...)
-
tryLocalSourceFirst: aBoolean
-
if true, local source files are tried first, before a sourceCodemanager is
consulted. This may speed up the source access, but adds some insecurity, because
the sourceCodemanager is always getting the source for the classes correct version.
In contrast, the local file might be different from (edited in an external tool) in
the meantime. You have been warned - better leave it false (the sourceCodemanager will
fill its cache and eventually be just as fast...)
-
updateChanges: aBoolean
-
turn on/off changes management. Return the prior value of the flag.
This value is used as a default fallback - a querySignal handler may still
decide to return something else.
-
updatingChanges
-
return true if changes are recorded.
The value returned here is the default fallback - a querySignal handler may still
decide to return something else.
creating new classes
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames category: categoryString
-
this new instance creation protocol will replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames category: categoryString
-
this new instance creation protocol will replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames classInstanceVariableNames: stringOfClassInstVarNames poolDictionaries: stringOfPoolNames category: categoryString
-
this new instance creation protocol will replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryString
-
this new instance creation protocol will replace the traditional inst-creation messages
helpers
-
nameWithoutPrefix: name
-
helper for fileOut and others - return a name's printString,
without any owningClass or nameSpace prefix
-
revisionInfoFromString: aString
-
return a revision info, given a string.
This extracts the relevant info from aString, asking
the default sourceCode manager (if there is one).
Notice, that this method is only invoked, if a class does not know
its sourceCode manager.
-
revisionStringFromSource: aMethodSourceString
-
extract a revision string from a methods source string.
Caveat: Assumes CVS.
misc
-
template: aCategoryString
-
return a class-definition template
private
-
flushSubclassInfo
-
throw away (forget) the cached subclass information, as created
by #subclassInfo.
This is private protocol
-
flushSubclassInfoFor: aClass
-
throw away (forget) the cached subclass information for aClass, as created
by #subclassInfo.
This is private protocol
-
subclassInfo
-
build & return a dictionary, containing the set of subclass
for each class. This information is kept until explicitely flushed
by #flushSubclassInfo.
This cache is used internally, for enumerators like #allSubclasses
or #allSubclassesDo:, to avoid repeated recursive walks over the class
hierarchy.
This is private protocol.
queries
-
isBuiltInClass
-
return true if this class is known by the run-time-system.
Here, true is returned for myself, false for subclasses.
Compatibility-Dolphin
-
defaultCategoryForDolphinClasses
-
-
stb_version
-
-
subclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s classInstanceVariableNames: classInstanceVariableNames
-
this method allows fileIn of Dolphin classes
-
variableSubclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s classInstanceVariableNames: classInstanceVariableNames
-
this method allows fileIn of Dolphin classes
Compatibility-ST/V and V'Age
-
defaultCategoryForSTVorVAGEClasses
-
-
subclass: nm classInstanceVariableNames: cIV instanceVariableNames: iV classVariableNames: cV poolDictionaries: p
-
this method allows fileIn of V'Age classes
-
subclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age classes
(which seem to have no category)
-
variableByteSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable byte classes
(which seem to have no category and no instvars)
-
variableLongSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes
(which seem to have no category and no instvars)
-
variableSubclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable pointer classes
(which seem to have no category)
-
variableWordSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes
(which seem to have no category and no instvars)
Compatibility-ST80
-
fileOutSourceOn: aStream
-
-
rename: newName
-
same as renameTo: - for ST80 compatibility
accessing
-
addChangeRecordForClass: aClass andNotifyChangeOf: aspect
-
writes a change record and notifies dependents.
-
addClassVarName: aString
-
add a class variable if not already there and initialize it with nil.
Also writes a change record and notifies dependents.
-
allPrivateClasses
-
return a collection of all private classes and private-private classes.
The classes are in any order.
-
category
-
return the category of the class.
The returned value may be a string or symbol.
-
category: aStringOrSymbol
-
set the category of the class to be the argument, aStringOrSymbol
-
classBaseFilename
-
return the baseName of the file from which the class was compiled.
In contrast to classFilename, this will always be a plain basename.
-
classFilename
-
return the name of the file from which the class was compiled.
If the class was loaded via an explicit load (i.e. from the fileBrowser),
this will be an absolute path. Oherwise, it will be a basename only.
See classBaseFilename for a method which always returns the basename.
-
classPool
-
return something which allows access to my classVariables via
#at: and #at:put: messages.
-
classVarAt: aSymbol
-
return the value of a class variable.
Currently, this returns nil if there is no such classvar -
this may change.
-
classVarAt: aSymbol ifAbsent: exceptionBlock
-
return the value of a class variable.
Currently, this returns nil if there is no such classvar -
this may change.
-
classVarAt: aSymbol put: something
-
store something in a classvariable.
Currently this creates a global with a funny name if no such
classVar exists - this may change.
-
classVarNames
-
return a collection of the class variable name-strings.
Only names of class variables defined in this class are included
in the returned collection - use allClassVarNames, to get all known names.
-
classVariableString
-
return a string of the class variables names.
Only names of class variables defined in this class are in the
returned string.
-
classVariableString: aString
-
set the classes classvarnames string;
Initialize new class variables with nil, clear and remove old ones.
No change record is written and no classes are recompiled.
-
comment
-
return the comment (aString) of the class
-
comment: aStringOrNil
-
set the comment of the class to be the argument, aString;
create a change record and notify dependents.
-
environment
-
return the namespace I am contained in; ST-80 compatible name
-
generateClassFilename
-
generate the expected filename for this class - without suffix.
This may be different from the actual classFilename
-
getClassFilename
-
return the name of the file from which the class was compiled.
If the class was loaded via an explicit load (i.e. from the fileBrowser),
this will be an absolute path. Oherwise, it will be a basename only.
-
getPackage
-
get the package or nil.
-
globalKeyForClassVar: aStringOrSymbol
-
this helps to encapsulate the (current) implementation of classVariables
from the outside world. Currently, classvars are stored in
the Smalltalk dictionary with a funny name, since there are
no classPools yet.
-
name
-
return the name of the class.
This returns a symbol (but notice, that other smalltalks might return a string).
-
nameSpace
-
return the namespace I am contained in;
For private or anonymous classes, nil is returned -
for public classes, Smalltalk is returned.
-
package
-
return the package-ID-Symbol of the class.
-
package: aSymbol
-
set the package-ID.Symbol of the class.
-
primitiveDefinitions: aString
-
set the primitiveDefinition string
-
primitiveDefinitionsString
-
return the primitiveDefinition string or nil
-
primitiveDefinitionsStringOrDefault
-
return the primitiveDefinition string or a default
-
primitiveFunctions: aString
-
set the primitiveFunction string
-
primitiveFunctionsString
-
return the primitiveFunctions string or nil
-
primitiveFunctionsStringOrDefault
-
return the primitiveFunction string or a default
-
primitiveVariables: aString
-
set the primitiveVariable string
-
primitiveVariablesString
-
return the primitiveVariables string or nil
-
primitiveVariablesStringOrDefault
-
return the primitiveVariable string or a default
-
privateClassNamed: aClassNameStringOrSymbol
-
-
privateClasses
-
return a collection of my private classes (if any).
The classes are in any order.
-
privateClassesAt: aClassNameStringOrSymbol
-
return a private class if present; nil otherwise
-
privateClassesAt: aClassNameStringOrSymbol put: aClass
-
add a private class
-
privateClassesOrAll: allOfThem
-
return a collection of my direct private classes (if any)
or direct plus indirect private classes (if allOfThem).
An empty collection if there are none.
The classes are in any order.
-
privateClassesSorted
-
return a collection of my private classes (if any).
The classes are sorted by inheritance.
-
projectDefinition
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
projectDefinitionClass
-
return the project definition of the classes package
-
realSharedPools
-
this returns the namespace aware pool names
-
removeClassVarName: aString
-
remove a class variable if not already there.
Also writes a change record and notifies dependents.
-
setCategory: aStringOrSymbol
-
set the category of the class to be the argument, aStringOrSymbol
-
setClassFilename: aFilename
-
set the classes filename.
This is a dangerous (low level) operation,
since the comment and primitiveSpecs may no longer be accessable,
if a wrong filename is set here.
-
setClassVariableString: aString
-
set the classes classvarnames string.
This is a dangerous (low level) operation, since the
classvariables are not really created or updated. Also,
NO change record is written.
-
setComment: aString
-
set the comment of the class to be the argument, aString;
do NOT create a change record
-
setComment: com category: categoryStringOrSymbol
-
set the comment and category of the class;
do NOT create a change record
-
setEnvironment: aNamespace
-
set the namespace I am contained in; ST-80 compatible name
-
setPackage: aSymbol
-
set the package of the class.
-
sharedPools
-
this returns the plain (non-namespace aware) pool names
-
sharedPools: aStringOrCollection
-
set the sharedPools string (no change notifications)
-
source
-
return the classes full source code
-
sourceCodeManager
-
return my source code manager.
For now, all classes return the same global manager.
But future versions may support mixed reporitories
-
subclasses
-
return a collection of the direct subclasses of the receiver
-
superclass: aClass
-
set the superclass - this actually creates a new class,
recompiling all methods for the new one. The receiving class stays
around anonymously to allow existing instances some life.
This may change in the future (adjusting existing instances)
adding & removing
-
removeFromSystem
-
ST-80 compatibility
remove myself from the system
-
unload
-
if the receiver was autoloaded, unload and reinstall it as
autoloaded. Can be used to get rid of no longer needed autoloaded
classes.
(maybe, autoloaded classes should unload themselfes when no
longer needed - for example, after some delay when the last instance
is gone ...)
binary storage
-
addGlobalsForBinaryStorageTo: globalDictionary
-
classPool == nil ifFalse: [
classPool associationsDo: [:assoc|
globalDictionary at: assoc put: self
]
]
-
binaryClassDefinitionFrom: stream manager: manager
-
retrieve a class as stored previously with
#storeBinaryClassOn:manager:
The namespace, where the class is to be installed is queries via the
NameSpaceQuerySignal - it should answer with nil, to suppress installation.
-
storeBinaryClassOn: stream manager: manager
-
store a classes complete description (i.e. including methods).
However, the superclass chain is not stored - at load time, that must
be either present or autoloadable.
-
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
-
not usable at the moment - there are no classpools currently
-
storeBinaryDefinitionOn: stream manager: manager
-
store the receiver in a binary format on stream.
This is an internal interface for binary storage mechanism.
classes only store the name, signature and instvar names.
They restore by looking for that name in the Smalltalk dictionary.
However, using the signature, a check for being valid is made at
restore time.
This avoids a full recursive store of a class in the normal binary
storage - however, it also means that a classes semantics cannot
be stored with the basic storeBinary operation
(we depend on the class being present at binaryLoad time.
To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:.
changes management
-
addChangeRecordForChangeCategory
-
add a category change
-
addChangeRecordForClass: aClass
-
add a class-definition-record to the changes file
-
addChangeRecordForClassCheckIn: aClass
-
append a class-was-checkedIn-record to the changes file
-
addChangeRecordForClassComment: aClass
-
add a class-comment-record to the changes file
-
addChangeRecordForClassContainerRemove: aClass
-
append a container-was-removed-record to the changes file
-
addChangeRecordForClassFileOut: aClass
-
append a class-was-filedOut-record to the changes file
-
addChangeRecordForClassInstvars: aClass
-
add a class-instvars-record to the changes file
-
addChangeRecordForClassRemove
-
add a class-remove-record to the changes file
-
addChangeRecordForClassRemove: oldClassName
-
add a class-remove-record to the changes file
-
addChangeRecordForClassRename: oldName to: newName
-
add a class-rename-record to the changes file
-
addChangeRecordForPrimitiveDefinitions: aClass
-
add a primitiveDefinitions-record to the changes file
-
addChangeRecordForPrimitiveFunctions: aClass
-
add a primitiveFunctions-record to the changes file
-
addChangeRecordForPrimitiveVariables: aClass
-
add a primitiveVariables-record to the changes file
-
addChangeRecordForSnapshot: aFileName
-
add a snapshot-record to the changes file
-
addChangeRecordForSnapshot: aFileName to: aStream
-
add a snapshot-record to aStream
enumerating
-
allPrivateClassesDo: aBlock
-
evaluate aBlock on all of my private classes (if any).
Evaluation is in no particular order.
-
privateClassesDo: aBlock
-
evaluate aBlock on all of my (immediate) private classes (if any).
Evaluation is in no particular order.
-
subclassesDo: aBlock
-
evaluate the argument, aBlock for all immediate subclasses.
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.
-
withAllPrivateClassesDo: aBlock
-
evaluate aBlock on myself and all of my private classes (if any).
This recurses into private classes of private classes.
Evaluation is in no particular order.
fileIn interface
-
primitiveDefinitions
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveDefinitions section.
Thus, although the definitions are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
-
primitiveFunctions
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveFunctions section.
Thus, although the functions are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
-
primitiveVariables
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveVariables section.
Thus, although the variables are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
fileOut
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace
-
append an expression on aStream, which defines myself.
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace withPackage: showPackage
-
append an expression on aStream, which defines myself.
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace withPackage: showPackage syntaxHilighting: syntaxHilighting
-
append an expression on aStream, which defines myself.
-
basicFileOutInstvarTypeKeywordOn: aStream
-
a helper for fileOutDefinition
-
fileOut
-
create a file 'class.st' consisting of all methods in myself in
sourceForm, from which the class can be reconstructed (by filing in).
If the current project is not nil, create the file in the projects
directory. Care is taken, to not clobber any existing file in
case of errors (for example: disk full).
Also, since the classes methods need a valid sourcefile, the current
sourceFile may not be rewritten.
-
fileOutAllMethodsOn: aStream
-
-
fileOutAllMethodsOn: aStream methodFilter: methodFilter
-
-
fileOutAs: fileNameString
-
create a file consisting of all methods in myself in
sourceForm, from which the class can be reconstructed (by filing in).
The given fileName should be a full path, including suffix.
Care is taken, to not clobber any existing file in
case of errors (for example: disk full).
Also, since the classes methods need a valid sourcefile, the current
sourceFile may not be rewritten.
-
fileOutClassInstVarDefinitionOn: aStream
-
append an expression to define my classInstanceVariables on aStream
-
fileOutClassInstVarDefinitionOn: aStream withNameSpace: withNameSpace
-
append an expression to define my classInstanceVariables on aStream
-
fileOutCommentOn: aStream
-
append an expression on aStream, which defines my comment
-
fileOutDefinitionOn: aStream
-
append an expression on aStream, which defines myself.
-
fileOutIn: aDirectoryName
-
create a file 'class.st' consisting of all methods in self in
directory aDirectoryName (ignoring any directory setting in
the current project).
This is not logged in that change file (should it be ?).
-
fileOutIn: aDirectoryName withTimeStamp: withTimeStamp
-
create a file 'class.st' consisting of all methods in self in
directory aDirectoryName (ignoring any directory setting in
the current project).
This is not logged in that change file (should it be ?).
-
fileOutOn: aStream
-
file out my definition and all methods onto aStream
-
fileOutOn: aStream withTimeStamp: stampIt
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
-
fileOutOn: aStream withTimeStamp: stampIt withInitialize: initIt
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
-
fileOutOn: aStream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
-
fileOutOn: outStreamArg withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter encoder: encoderOrNil
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
-
fileOutPrimitiveDefinitionsOn: aStream
-
append primitive defs (if any) to aStream.
-
fileOutPrimitiveSpecsOn: aStream
-
append primitive defs (if any) to aStream.
fileOut-binary
-
binaryFileOut
-
create a file 'class.cls' (in the current projects fileOut-directory),
consisting of all methods in myself in a portable binary format.
The methods source is saved by reference
to the classes sourceFile if there is any.
That sourcefile needs to be present after reload in order to be
browsable.
-
binaryFileOutOn: aStream
-
append a binary representation of myself to aStream
-
binaryFileOutOn: aStream sourceMode: sourceMode
-
append a binary representation of myself to aStream in
a portable binary format.
The argument controls how sources are to be saved:
#keep - include the source
#reference - include a reference to the sourceFile
#discard - dont save sources.
With #reference, the sourceFile needs to be present after reload
in order to be browsable.
-
binaryFileOutWithSourceMode: sourceMode
-
create a file 'class.cls' (in the current projects fileOut-directory),
consisting of all methods in myself in a portable binary format.
The argument controls how sources are to be saved:
#keep - include the source
#reference - include a reference to the sourceFile
#discard - dont save sources.
With #reference, the sourceFile needs to be present after reload
in order to be browsable.
-
binaryFileOutWithSourceMode: sourceMode as: fileNameString
-
create a file fileNameString,
consisting of all methods in myself in a portable binary format.
The argument controls how sources are to be saved:
#keep - include the source
#reference - include a reference to the sourceFile
#discard - dont save sources.
With #reference, the sourceFile needs to be present after reload
in order to be browsable.
fileOut-xml
-
fileOutXML
-
create a file 'class.xml' consisting of all methods in myself in
XML sourceForm.
If the current project is not nil, create the file in the projects
directory. Care is taken, to not clobber any existing file in
case of errors (for example: disk full)
-
fileOutXMLAllDefinitionsOn: aStream
-
append xml expressions on aStream, which defines myself and all of my private classes.
-
fileOutXMLAllMethodsOn: aStream methodFilter: methodFilter
-
-
fileOutXMLAs: fileNameOrString
-
create a file consisting of all methods in myself in
XML sourceForm.
The given fileName should be a full path, including suffix.
-
fileOutXMLDefinitionOn: aStream
-
append an xml expression on aStream, which defines myself.
-
fileOutXMLOn: aStream
-
WARNING: untested first version. Not for general use (yet)
file out my definition and all methods onto aStream in XML format.
-
fileOutXMLOn: aStream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter
-
WARNING: untested first version. Not for general use (yet)
file out my definition and all methods onto aStream in XML format.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
printOut
-
htmlDocumentation
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
printClassVarNamesOn: aStream indent: indent
-
print the class variable names indented and breaking at line end
-
printFullHierarchyOn: aStream indent: indent
-
print myself and all subclasses on aStream.
recursively calls itself to print subclasses.
Can be used to print hierarchy on the printer.
-
printOutDefinitionOn: aPrintStream
-
print out my definition
-
printOutOn: aPrintStream
-
print out all methods on aPrintStream which should be a printStream
-
printOutProtocolOn: aPrintStream
-
-
printSharedPoolNamesOn: aStream indent: indent
-
print the pool names indented and breaking at line end
-
storeOn: aStream
-
append my name only - expects class to be there, when restoring
private-accessing
-
attributes
-
return the extra class attributes or nil
-
attributes: aClassAttributesObject
-
set the extra class attributes
-
classAttributes
-
return the extra class attributes or create them if nil.
Notice that the stc-compiler is too stupid to generate instances of ClassAttributes directly;
therefore, it generates arrays which are converted here, when we first access the attribute.
-
classAttributes: aClassAttributesObject
-
set the extra class attributes
-
flushSubclasses
-
-
getAttribute: aKey
-
get an attribute (by symbolic key)
-
getSourceChunkAttribute: aKey
-
-
setAttribute: key to: aValue
-
-
setName: aString
-
set the classes name - be careful, it will be still
in the Smalltalk dictionary - under another key.
This is NOT for general use - see renameTo:
-
setPrimitiveDefinitions: aString
-
set the primitiveDefinition string (no change notifications)
-
setPrimitiveFunctions: aString
-
set the primitiveFunction string (no change notifications)
-
setPrimitiveVariables: aString
-
set the primitiveVariable string (no change notifications)
-
setSharedPools: aStringOrCollection
-
set the sharedPools string (no change notifications)
-
setSubclasses: aCollection
-
-
setSuperclass: aClass
-
set the superclass of the receiver.
this method is for special uses only - there will be no recompilation
and no change record written here. Also, if the receiver class has
already been in use, future operation of the system is not guaranteed to
be correct, since no caches are flushed.
Therefore: do NOT use it; use #superclass: (or flush the caches, at least).
-
updateAllCachedSubclasses
-
private-changes management
-
addChangeRecordForChangeCategory: category to: aStream
-
append a category change record to aStream
-
addChangeRecordForClass: aClass to: aStream
-
append a class-definition-record to aStream
-
addChangeRecordForClassComment: aClass to: aStream
-
append a class-comment-record to aStream
-
addChangeRecordForClassInstvars: aClass to: aStream
-
append an instvars-record to aStream
-
addChangeRecordForClassRemove: oldClass to: aStream
-
append a class-remove-record to aStream
-
addChangeRecordForClassRename: oldName to: newName to: aStream
-
append a class-rename-record to aStream
-
addChangeRecordForPrimitiveDefinitions: aClass to: aStream
-
append a primitiveDefinitions-record to aStream
-
addChangeRecordForPrimitiveFunctions: aClass to: aStream
-
append a primitiveFunctions-record to aStream
-
addChangeRecordForPrimitiveVariables: aClass to: aStream
-
append a primitiveVariables-record to aStream
queries
-
canHaveExtensions
-
return true, if this class allows extensions from other packages.
Private classes, namespaces and projectDefinitions dont allow this
-
classResources
-
-
extensions
-
return a collection of extension-methods from any package, or empty if there are none.
-
extensionsFrom: aPackageID
-
return the set of extension-methods from the given package.
-
hasExtensions
-
return true, if there are methods in the receiver, which belong to
a different package (i.e. package of class ~= package of method).
Those are class extensions, which must be treated specially when checking classes
into the sourceCode repository. (extensions are stored separate)
-
hasExtensionsFrom: aPackageID
-
return true, if there are methods in the receiver, which belong to
the package with aPackageID (i.e. package of class ~= package of method).
Those are class extensions, which must be treated specially when checking classes
into the sourceCode repository. (extensions are stored separate)
-
hasUnsavedChanges
-
return true, if there are changes for this class in the current changeSet
-
isBrowserStartable
-
return true, if this is an application class,
which can be started from the browser
-
isClass
-
return true, if the receiver is some kind of class
(a real class, not just behavior);
true is returned here - the method is redefined from Object.
See also Behavior>>isBehavior.
-
isJavaScriptClass
-
-
isStartableWithMain
-
return true, if this is an application class,
which can be started via #main
-
isStartableWithStart
-
return true, if this is an application class,
which can be started via #start
-
packageDirectory
-
return the packageDirectory of this classes package.
That is usually the directory where my source is, and where package specific additional
files (bitmaps, resources etc.) are found.
-
rootsOfTheWorld
-
return a collection of classes which have a nil superclass
-
wasAutoloaded
-
return true, if this class came into the system via an
autoload; false otherwise.
This is not an attribute of the class, but instead remembered in
Autoload. The interface here is for your convenience.
-
whichClassDefinesClassVar: aVariableName
-
return the class which defines the class variable
named aVariableName. This method should not be used for
repeated searches (i.e. in the compiler/parser), since it creates
many throw away intermediate objects.
renaming
-
makePrivateIn: newOwner
-
make a private class of newOwner from the receiver;
the receiver must be a public class.
Returns the new private class.
-
makePublic
-
make a public class from the receiver.
The receiver must be a private class.
Returns the new public class.
-
makePublicIn: newNameSpace
-
make a public class from the receiver.
The receiver must be a private class.
Returns the new public class.
-
renameTo: newName
-
change the name of the class. This does not write a change record.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
signature checking
-
classinstSizeFromSignature: aSignature
-
for checking class compatibility: return some number based on
the classinstSize from a signature key (not always the real classinstsize).
-
instNameKeyFromSignature: aSignature
-
for checking class compatibility: return a number based on the
names and order of the instance variables from a signature key.
-
instSizeFromSignature: aSignature
-
for checking class compatibility: return the some number based on
the instSize from a signature key (not always the real instSize).
-
instTypeFromSignature: aSignature
-
for checking class compatibility: return some number based on
the instType (i.e. variableBytes/Pointers etc.) from a signature key.
-
signature
-
return a signature number - this number is useful for a quick
check for changed classes, and is done in the binary-object loader,
and the dynamic class loader.
Do NOT change the algorithm here - others may depend on it.
Also, the algorithm may change - so never interpret the returned value
(if at all, use the access #XXXFromSignature: methods)
source management
-
binaryRevision
-
return the revision-ID from which the class was stc-compiled;
nil if its an autoloaded or filedIn class.
If a classes binary is up-to-date w.r.t. the source repository,
the returned string is the same as the one returned by #revision.
-
currentSourceStream
-
return an open stream on the current source of the receiver
-
findVersionMethod
-
return my revision method. Either this is the sourceCodeManager-specific versionMethod,
or the fallBack (for backward compatibility)
-
localSourceStreamFor: sourceFile
-
return an open stream on a local sourcefile, nil if that is not available
-
nameOfVersionMethod
-
-
packageSourceCodeInfo
-
return the sourceCodeInfo, which defines the module and the subdirectory
in which the receiver class was built.
This info is extracted from the package id (which is added to stc-compiled classes).
This method is to be obsoleted soon, since the same info is now found
in the versionString.
The info returned consists of a dictionary
filled with (at least) values at: #module, #directory and #library.
If no such info is present in the class, nil is returned.
(this happens with autoloaded and filed-in classes)
Auotloaded classes set their package from the revisionInfo, if present.
By convention, this info is encoded in the classes package
string (which is given as argument to stc) as the last word in parenthesis.
The info consists of 1 to 3 subcomponents, separated by colons.
The first defines the classes module (i.e. some application identifier),
the second defines the subdirectory within that module, the third
defines the name of the class library.
If left blank, the module info defaults to 'stx',
the directory info defaults to library name.
The library name may not be left blank.
(this is done for backward compatibility,)
For example:
'....(libbasic)' -> module: stx directory: libbasic library: libbasic
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface
'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase
The way how the sourceCodeManager uses this to find the source location
depends on the scheme used. For CVS, the module is taken as the -d arg,
while the directory is prepended to the file name.
Other schemes may do things differently - these are not yet specified.
Caveat:
Encoding this info in the package string seems somewhat kludgy.
-
projectDirectory
-
return my projects directory - thats where the sources, binaries, classLib,
resources etc. are typically found.
-
resourceDirectory
-
return the directory where my resource file is supposed to live.
Here, take the package and assume that a directory named 'resources' exists
in my package directory.
Return nil, if no such directory exists.
-
resourcePackName
-
return the name which is used as the fileNameBase of my resource file.
Notice, that this will undergo the same name translation process as
done with class-source file names. (see ResourcePack).
The default here is the classes name - this can be redefined in classes
which want to use another classes resources (NewLauncher -> Launcher).
-
resourcePackage
-
return the package from where my resources are loaded.
By default, that is the classes package.
-
revision
-
return the revision-ID of the class which corresponds to the
cvs-id of the source to which this class is equivalent.
Initially, this is the same as #binaryRevision; however, once changes have
been checked into a source repository, the binary continues to remain based upon
the old revision, while logically, the class has the new (checked-in) revision.
To check if a source corresponds to a compiled binary, compare this
ID with the one returned by #binaryRevision.
-
revisionDateString
-
return the revision-Date of the class as a string.
This is extracted from the version string.
-
revisionInfo
-
return an object filled with revision info.
This extracts the relevant info from the revisionString.
The revisionInfo contains all or a subset of:
binaryRevision - the revision upon which the binary of this class is based
revision - the revision upon which the class is based logically
(different, if a changed class was checked in, but not yet recompiled)
user - the user who checked in the logical revision
date - the date when the logical revision was checked in
time - the time when the logical revision was checked in
fileName - the classes source file name
repositoryPath - the classes source container
-
revisionString
-
return my revision string; that one is extracted from the
classes #version method. Either this is a method returning that string,
or it's a comment-only method and the comment defines the version.
If the receiver is unloaded, or the source is not accessable,
or no such method exists, then nil is returned.
-
setBinaryRevision: aString
-
set the revision-ID.
This should normally not be done in the running system, as the source-manager
will need this to validate sourcefiles being correct for a given binary
(and optionally: extracting the required sourcefile from the rcs source)
-
setPackageFromRevision
-
set my package from the info found in the revisionString if present.
This is used to set some useful packageInfo after autoloading
(otherwise, autoloaded classes/methods would go into your current
package - which is probably not a good idea)
-
sourceFileSuffix
-
-
sourceStream
-
return an open stream on my sourcefile, nil if that is not available
-
sourceStreamFor: source
-
return an open stream on a sourcefile, nil if that is not available
-
updateVersionMethodFor: newRevisionString
-
helper for the checkin procedure.
Update my #version method, to now return newRevisionString.
-
validateSourceStream: aStream
-
check if aStream really contains my source.
This is done by checking the version method's return value
against the version string as contained in the version method.
This helps to detect mangled source code.
-
versionMethodTemplateForSourceCodeManager: aSourceCodeManager
-
ClassAttributes
SimulatedClassPool
|