Class JavaProject

java.lang.Object
com.iizigo.java.JavaProject
All Implemented Interfaces:
IResourceDeltaVisitor

public class JavaProject extends Object implements IResourceDeltaVisitor
The Java project class. It handles Java file enumeration, visiting, and most of all the source folders with the IIZI metadata for parsing.
Author:
Christopher Mindus
  • Method Details

    • getJavaRootContainer

      public JavaRootContainer getJavaRootContainer()
      Gets the property Java container root for Module projects.
    • doValidateReferences

      public void doValidateReferences(boolean doReCheck)
      Validates the references for this project.
      Parameters:
      doReCheck - If a re-check of all references must be done.
    • getProject

      public IProject getProject()
      Gets the project.
    • getModuleModel

      public ModuleModel getModuleModel()
      Gets the Module model.
      Returns:
      The Module model or null if not yet created or not a Module project.
    • finalize

      protected void finalize() throws Throwable
      Finalized?
      Overrides:
      finalize in class Object
      Throws:
      Throwable - For finalizer errors.
    • visit

      public boolean visit(IResourceDelta delta) throws CoreException
      If one of the folders are found, let the main class handle the visiting.
      Specified by:
      visit in interface IResourceDeltaVisitor
      Throws:
      CoreException
    • isParsingRequired

      public boolean isParsingRequired()
      Checks if this project is included in any of the Module projects, thus needs parsing.

      LOCK ORDER: the Project Manager's lock first, then the JavaManager, then this JavaProject. That is the order of a project load: ModuleModel.from and the Project Manager call ModuleNature.setProject under the Project Manager's lock, and its new ModuleModel goes on to JavaManager.onOpen and onOpen(ModuleModel). ProjectManager.getLoadedModuleModels() takes the Project Manager's lock, so it is called here with this monitor NOT held. The Java builder asks this question at the start of every build (JavaCompilationParticipant.isActive): when it waited for the Project Manager's lock inside this monitor while a load held that lock and waited for this monitor, neither of them ever ended. Nothing called under this monitor may take the Project Manager's lock or the monitor of the JavaManager.

      The answer is kept until it is forgotten (forgetParsingRequired()). A Module model that is handed over while the Project Manager is asked decides the answer; an answer asked for before it was forgotten is not kept after it.

      Returns:
      true if the Java sources of this project are parsed: it is a Module project, or it is on the build path of a loaded Module project.