|
Class: Visitor
Object
|
+--Visitor
|
+--AspectVisitor
- Package:
- stx:libbasic
- Category:
- System-Visiting
- Version:
- rev:
1.13
date: 2018/07/03 22:46:40
- user: cg
- file: Visitor.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Stefan Vogel (stefan@zwerg)
This class is abstract and implements the visitor pattern.
It defines #visitXXX:with: messages for various kinds of objects.
Any of these messages is eventually mapped to #visitObject:with:.
When a class redefines #acceptVisitor:with:, an method has to be defined here, too.
Subclasses have to define at least #visitObject:with:
[bject>>acceptVisitor]
queries
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
helpers
-
doesNotUnderstand: aMessage
-
catch unimplemented #visitXXX:with: messages and redirect them to #visitObject:with:.
maybe someone implemented an #acceptVisitor:with: in the XXX class and didn't
implement the corresponding method here.
This should not happen, and a error message is printed, because this can also
occur due to a typo.
-
visitChildrenOf: anObject
-
recursively enumerate anObjects refs, visiting each of the child objects.
nil children are not visited
subclass responsibility
-
nextObject
-
this is sent, when a new Object is going to be visited.
Subclasses may redefine this to perform specific actions
-
visitObject: anObject with: aParameter
-
visit an object. Subclasses must at least implement this method
** This method raises an error - it must be redefined in concrete classes **
-
visitProtoObject: anObject with: aParameter
-
visit a proto object.
** This method raises an error - it must be redefined in concrete classes **
visiting smalltalk types
-
visitBehavior: aSymbol with: aParameter
-
visit a class - fallback here is to call visitObject
-
visitBitArray: aByteArray with: aParameter
-
visit an absolute time value
-
visitBlock: aBlock with: aParameter
-
-
visitBoolean: aBoolean with: aParameter
-
visit a Boolean - fallback here is to call visitObject
-
visitByteArray: aByteArray with: aParameter
-
visit a ByteArray value
-
visitCharacter: aCharacter with: aParameter
-
visit a Character - fallback here is to call visitObject
-
visitCollection: aCollection with: aParameter
-
visit a Collection - fallback here is to call visitObject
-
visitDate: aDate with: aParameter
-
visit a date value - fallback here is to call visitObject
-
visitDictionary: aDictionary with: aParameter
-
visit a Dictionary
-
visitFloat: aFloat with: aParameter
-
visit a Float
-
visitFraction: aFraction with: aParameter
-
visit a Fraction
-
visitInteger: anInteger with: aParameter
-
visit an Integer
-
visitInterval: anInterval with: aParameter
-
intervals are a special flavor of sequenceable collection (saving memory)
We treat it as SequenceableCollection by default.
Encoders that do a dense representation, redefine this to #visitObject
-
visitNilWith: aParameter
-
visit nil - fallback here is to call visitObject
-
visitNumber: aNumber with: aParameter
-
visit any number - fallback here is to call visitObject
-
visitSequenceableCollection: aCollection with: aParameter
-
visit a SequenceableCollection
-
visitSet: aCollection with: aParameter
-
visit a Set
-
visitStream: aStream with: aParameter
-
visit a Stream - fallback here is to call visitObject
-
visitString: aString with: aParameter
-
visit a String - fallback here is to call visitObject
-
visitSymbol: aSymbol with: aParameter
-
visit a Symbol
-
visitTime: aTime with: aParameter
-
visit a time value - fallback here is to call visitObject
-
visitTimestamp: aTimestamp with: aParameter
-
visit an timestamp value - fallback here is to call visitObject
-
visitUtcTimestamp: aTimestamp with: aParameter
-
visit an UTC timestamp value - fallback here is to call visitObject
|