eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Visitor':

Home

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

Class: Visitor


Inheritance:

   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)

Description:


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:


Related information:

    [bject>>acceptVisitor]

Class protocol:

queries
o  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.


Instance protocol:

helpers
o  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.

o  visitChildrenOf: anObject
recursively enumerate anObjects refs, visiting each of the child objects.
nil children are not visited

subclass responsibility
o  nextObject
this is sent, when a new Object is going to be visited.
Subclasses may redefine this to perform specific actions

o  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 **

o  visitProtoObject: anObject with: aParameter
visit a proto object.

** This method raises an error - it must be redefined in concrete classes **

visiting smalltalk types
o  visitBehavior: aSymbol with: aParameter
visit a class - fallback here is to call visitObject

o  visitBitArray: aByteArray with: aParameter
visit an absolute time value

o  visitBlock: aBlock with: aParameter

o  visitBoolean: aBoolean with: aParameter
visit a Boolean - fallback here is to call visitObject

o  visitByteArray: aByteArray with: aParameter
visit a ByteArray value

o  visitCharacter: aCharacter with: aParameter
visit a Character - fallback here is to call visitObject

o  visitCollection: aCollection with: aParameter
visit a Collection - fallback here is to call visitObject

o  visitDate: aDate with: aParameter
visit a date value - fallback here is to call visitObject

o  visitDictionary: aDictionary with: aParameter
visit a Dictionary

o  visitFloat: aFloat with: aParameter
visit a Float

o  visitFraction: aFraction with: aParameter
visit a Fraction

o  visitInteger: anInteger with: aParameter
visit an Integer

o  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

o  visitNilWith: aParameter
visit nil - fallback here is to call visitObject

o  visitNumber: aNumber with: aParameter
visit any number - fallback here is to call visitObject

o  visitSequenceableCollection: aCollection with: aParameter
visit a SequenceableCollection

o  visitSet: aCollection with: aParameter
visit a Set

o  visitStream: aStream with: aParameter
visit a Stream - fallback here is to call visitObject

o  visitString: aString with: aParameter
visit a String - fallback here is to call visitObject

o  visitSymbol: aSymbol with: aParameter
visit a Symbol

o  visitTime: aTime with: aParameter
visit a time value - fallback here is to call visitObject

o  visitTimestamp: aTimestamp with: aParameter
visit an timestamp value - fallback here is to call visitObject

o  visitUtcTimestamp: aTimestamp with: aParameter
visit an UTC timestamp value - fallback here is to call visitObject



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 25 Apr 2024 10:31:20 GMT