Class CompilationFactory


  • public final class CompilationFactory
    extends java.lang.Object
    Creates compilation roots for source files. The returned roots may be shared.
    Author:
    Chris Jennings
    • Method Detail

      • getProjectRoots

        public static CompilationRoot[] getProjectRoots()
        Returns an array of all compilation roots created for the open project. This returns all of the shared roots that have been initialized so far, not all of the possible roots.
        Returns:
        an array of the compilation roots
      • forMember

        public static CompilationRoot forMember​(Member member)
        Returns a shared compilation root for the project member. Typically, each plug-in task folder has its own separate root, and there is one root for the project as a whole.
        Parameters:
        member - the member to get a compilation root for
        Returns:
        the shared compilation root
      • forFile

        public static CompilationRoot forFile​(java.io.File file)
        Returns a compilation root for the specified file. If the file is part of the open project, returns the same root that would be returned for the file's project member. Otherwise, returns a new standalone root.
        Parameters:
        file - the file to obtain a compilation root for
        Returns:
        the file's compilation root