Class ExternalAnnotationTracker

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.ExternalAnnotationTracker
All Implemented Interfaces:
EventListener, org.eclipse.core.resources.IResourceChangeListener

public class ExternalAnnotationTracker extends Object implements org.eclipse.core.resources.IResourceChangeListener
Track changes of external annotation files and trigger closing / reloading of affected ClassFiles.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    registerClassFile​(org.eclipse.core.runtime.IPath annotationBase, org.eclipse.core.runtime.IPath relativeAnnotationPath, ClassFile classFile)
    Register a ClassFile, to which the annotation attachment 'annotationBase' applies.
    void
    resourceChanged​(org.eclipse.core.resources.IResourceChangeEvent event)
    Listen to resource change events concerning external annotations, that potentially affect a cached ClassFile.
    static void
    unregisterClassFile​(org.eclipse.core.runtime.IPath annotationBase, org.eclipse.core.runtime.IPath relativeAnnotationPath)
    Unregister a class file that is being closed.

    Methods inherited from class java.lang.Object

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

    • registerClassFile

      public static void registerClassFile(org.eclipse.core.runtime.IPath annotationBase, org.eclipse.core.runtime.IPath relativeAnnotationPath, ClassFile classFile)
      Register a ClassFile, to which the annotation attachment 'annotationBase' applies. This is done for the purpose to listen to changes in the corresponding external annotations and to force reloading the class file when necessary.
      Parameters:
      annotationBase - the path of the annotation attachment (workspace absolute)
      relativeAnnotationPath - path corresponding to the qualified name of the main type of the class file. The path is relative to 'annotationBase'. When appending the file extension for annotation files it points to the annotation file that would correspond to the given class file. The annotation file may or may not yet exist.
      classFile - the ClassFile to register.
    • unregisterClassFile

      public static void unregisterClassFile(org.eclipse.core.runtime.IPath annotationBase, org.eclipse.core.runtime.IPath relativeAnnotationPath)
      Unregister a class file that is being closed. Only to be invoked for class files that potentially are affected by external annotations.
      Parameters:
      annotationBase - path of the corresponding annotation attachment (workspace absolute)
      relativeAnnotationPath - path of the annotation file that would correspond to the given class file.
    • resourceChanged

      public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
      Listen to resource change events concerning external annotations, that potentially affect a cached ClassFile.
      Specified by:
      resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener