Class JavaCompilationParticipant


  • public class JavaCompilationParticipant
    extends org.eclipse.jdt.core.compiler.CompilationParticipant
    The Java compilation participant for all Java projects that could potentially be used in an iizi Module. It is used to process the Java compiled code to check annotations, references, etc., with the iizi Module projects and properties, and add problem markers. It is also used to feed information to the Java Manager about Java code so that it can be a part of the Refactoring engine for iizi Modules.
    Author:
    Christopher Mindus
    • Field Summary

      • Fields inherited from class org.eclipse.jdt.core.compiler.CompilationParticipant

        NEEDS_FULL_BUILD, READY_FOR_BUILD
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int aboutToBuild​(org.eclipse.jdt.core.IJavaProject project)
      Notifies this participant that a build is about to start and provides it the opportunity to create missing source folders for generated source files.
      void buildFinished​(org.eclipse.jdt.core.IJavaProject project)
      Notifies this participant that a build has finished for the project.
      void buildStarting​(org.eclipse.jdt.core.compiler.BuildContext[] files, boolean isBatch)
      Notifies this participant that a compile operation is about to start and provides it the opportunity to generate source files based on the source files about to be compiled.
      void cleanStarting​(org.eclipse.jdt.core.IJavaProject project)
      Notifies this participant that a clean is about to start and provides it the opportunity to delete generated source files.
      static void holdOperation​(java.lang.String what)
      Holds an operation during startup...
      boolean isActive​(org.eclipse.jdt.core.IJavaProject project)
      Returns whether this participant is active for a given project.
      boolean isAnnotationProcessor()
      Returns whether this participant is interested in only Annotations.
      void reconcile​(org.eclipse.jdt.core.compiler.ReconcileContext context)
      Notifies this participant that a reconcile operation is happening.
      • Methods inherited from class org.eclipse.jdt.core.compiler.CompilationParticipant

        processAnnotations
      • Methods inherited from class java.lang.Object

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

      • JavaCompilationParticipant

        public JavaCompilationParticipant()
    • Method Detail

      • holdOperation

        public static void holdOperation​(java.lang.String what)
        Holds an operation during startup...
      • isActive

        public boolean isActive​(org.eclipse.jdt.core.IJavaProject project)
        Returns whether this participant is active for a given project.
        Overrides:
        isActive in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        project - The project to participate in.
        Returns:
        true, participant is active for the given project.
      • cleanStarting

        public void cleanStarting​(org.eclipse.jdt.core.IJavaProject project)
        Notifies this participant that a clean is about to start and provides it the opportunity to delete generated source files.
        Overrides:
        cleanStarting in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        project - The project about to be cleaned.
      • aboutToBuild

        public int aboutToBuild​(org.eclipse.jdt.core.IJavaProject project)
        Notifies this participant that a build is about to start and provides it the opportunity to create missing source folders for generated source files. Additional source folders should be marked as optional so the project can be built when the folders do not exist.
        Overrides:
        aboutToBuild in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        project - The project about to build.
        Returns:
        READY_FOR_BUILD or NEEDS_FULL_BUILD.
      • buildStarting

        public void buildStarting​(org.eclipse.jdt.core.compiler.BuildContext[] files,
                                  boolean isBatch)
        Notifies this participant that a compile operation is about to start and provides it the opportunity to generate source files based on the source files about to be compiled.

        When isBatchBuild is true, then files contains all source files in the project.

        Overrides:
        buildStarting in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        files - An array of BuildContext.
        isBatch - Identifies when the build is a batch build.
      • buildFinished

        public void buildFinished​(org.eclipse.jdt.core.IJavaProject project)
        Notifies this participant that a build has finished for the project.

        This will be sent, even if buildStarting() was not sent when no source files needed to be compiled or the build failed.

        Overrides:
        buildFinished in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        project - The project about to build.
      • reconcile

        public void reconcile​(org.eclipse.jdt.core.compiler.ReconcileContext context)
        Notifies this participant that a reconcile operation is happening. The participant can act on this reconcile operation by using the given context. Other participant can then see the result of this participation on this context.

        Note that a participant should not modify the buffer of the working copy that is being reconciled.

        Overrides:
        reconcile in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Parameters:
        context - The reconcile context to act on.
      • isAnnotationProcessor

        public boolean isAnnotationProcessor()
        Returns whether this participant is interested in only Annotations.
        Overrides:
        isAnnotationProcessor in class org.eclipse.jdt.core.compiler.CompilationParticipant
        Returns:
        Whether this participant is interested in only Annotations, i.e. false = interested in more than just Annotations.