Class BaseMatcher

java.lang.Object
eu.bandm.tools.tdom.runtime.BaseMatcher
Direct Known Subclasses:
BaseMatcher, BaseMatcher, BaseMatcher, BaseMatcher

public class BaseMatcher extends Object
Super class for all generated matcher classes of a tdom model. A matcher enhances the visitor class as it is capable of identifying the class of the visitee dynamically. For this "double dispatch" is used.
(This is different than the strategy currently used in metatool umod, which implies less class loading.)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Semantic execution; can be overridden by the user when defining a particular visitor.
    void
    Generic entry point, can be called with any model instance which implements Visitable<V>, as defined in the generated model.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseMatcher

      public BaseMatcher()
  • Method Details

    • action

      protected void action(TypedPCData pcdata)
      Semantic execution; can be overridden by the user when defining a particular visitor. Will always be called when a TypedPCData is reached when traversing the model instance. This default implementation does nothing.
    • match

      public void match(Object o)
      Generic entry point, can be called with any model instance which implements Visitable<V>, as defined in the generated model. (The type-safe entry points in the generated classes are prefarable, namely faster and less error-prone.)
      Throws:
      TypeCastException - if interface is not implemented.