|
Class: Visitor
Object
|
+--Visitor
|
+--AspectVisitor
- Package:
- stx:libbasic
- Category:
- System-Visiting
- Version:
- rev:
1.17
date: 2021/01/20 16:02:33
- user: cg
- file: Visitor.st directory: libbasic
- module: stx stc-classLibrary: libbasic
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:, a method has to be defined here, too.
Subclasses have to define at least #visitObject:with:
The parameter passed to the 'with:' keyword can be anything;
for example, prettyprinters may pass the current indent with it.
copyrightCOPYRIGHT (c) 2002 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
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 must be redefined in concrete classes (subclassResponsibility) **
-
visitProtoObject: anObject with: aParameter
-
visit a proto object.
** This method must be redefined in concrete classes (subclassResponsibility) **
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
-
visitCDatum: aCDatum with: aParameter
-
visit a CDatum - fallback here is to call visitObject
-
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
-
visitXMLAttribute: anXMLAttribute with: aParameter
-
-
visitXMLElement: anXMLElement with: aParameter
-
|