Class DefCollector

java.lang.Object
org.checkerframework.afu.scenelib.el.DefCollector

public abstract class DefCollector extends Object
A DefCollector supplies a visitor for the annotation definitions in an AScene. First, call the DefCollector constructor passing the AScene. Then, call the visit method. This class exists primarily for the benefit of IndexFileWriter.write(AScene, Writer).
  • Constructor Details

    • DefCollector

      public DefCollector(AScene s) throws DefException
      Constructs a new DefCollector, which immediately collects all the definitions from annotations the given scene. Next call visit() to have the definitions passed back to you in topological order. If the scene contains two irreconcilable definitions of the same annotation type, a DefException is thrown.
      Throws:
      DefException
  • Method Details

    • visitAnnotationDef

      protected abstract void visitAnnotationDef(AnnotationDef d)
      Override this method to perform some sort of subclass-specific processing on the given AnnotationDef.

      It is only called once per annotation used in the scene, because each annotation is only defined once.

    • visit

      public final void visit()
      Calls visitAnnotationDef(org.checkerframework.afu.scenelib.el.AnnotationDef) on the definitions collected from the scene that was passed to the constructor. Visiting is done in topological order: if the definition of A contains a subannotation of type B, then B is guaranteed to be visited before A.