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.17 date: 2021/01/20 16:02:33
user: cg
file: Visitor.st directory: libbasic
module: stx stc-classLibrary: libbasic

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:, 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.

copyright

COPYRIGHT (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.

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 must be redefined in concrete classes (subclassResponsibility) **

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

** This method must be redefined in concrete classes (subclassResponsibility) **

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  visitCDatum: aCDatum with: aParameter
visit a CDatum - fallback here is to call visitObject

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

o  visitXMLAttribute: anXMLAttribute with: aParameter

o  visitXMLElement: anXMLElement with: aParameter



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 14 Oct 2024 01:35:40 GMT