Menu

GeneratedDesign

Walter Lyrer

Design of generated Visitor code

The Visitor Generator generates Visitor and RelationResolver classes using abstract classes from a framework which is also generated.

Please note that the generated Visitors are always stateful.

Abstract/Class Hierarchy

  • AbstractVisitor
    • Concrete Visitors
  • AbstractRelationResolver
    • Concrete Relation Resolvers

API methods

  • Abstract class AbstractVisitor

    • Class parameters:
      • CT: Type of the components in the component tree
      • EX: Type of used exception
    • API visiting methods
      • void visit(CT component) throws EX
        • Visits CT instance and traverses the related components according to the used RelationResolver
      • void reset()
        • Resets the visitor. This only makes the visitor reusable for a new component tree traversing. Not calling the reset method between two visits can lead to unexpected results.
  • Abstract class AbstractRelationResolver

    • Class parameters:
      • CT: Type of the components in the component tree
      • EX: Type of used exception
    • API relation methods
      • List<CT> getRelatedComponents(CT component)
        • Gets the related components. This method is used by the Visitor using it.
      • boolean hasRelatedComponents(CT component)
        • Checks if the component has related components or in other words is a leave node.

Copyright

Copyright by Walter Lyrer

Disclaimer

The author cannot be made responsible for any damage caused by the Visitor Generator.
The usage of the Visitor Generator is on own risk.
The code is designed and implemented on best know-how and with good intentions by the author.
Especially is to mention that the generated code of the Visitor Generator is not guaranteed to run instantly correct.
Manual supervision is necessary.

Author

Walter Lyrer

Other projects from same author

Jacoge Java Generator Eclipse Plugin
Converter Generator
Strategy/State Generator
Named Parameter Converter

Project Members:


Related

Wiki: GeneratedDocumentation