Class WorkspaceLibraryInfo

java.lang.Object
org.fife.rsta.ac.java.buildpath.LibraryInfo
net.mcreator.java.WorkspaceLibraryInfo
All Implemented Interfaces:
Cloneable, Comparable<org.fife.rsta.ac.java.buildpath.LibraryInfo>

public class WorkspaceLibraryInfo extends org.fife.rsta.ac.java.buildpath.LibraryInfo
A LibraryInfo over the directory with compiled workspace classes (Gradle build output), making code completion aware of the classes of the workspace itself. Unlike DirLibraryInfo, it tolerates the directory not existing yet (workspace that was not built).

The class list of a library is only indexed when the library is registered with a jar manager, so ProjectJarManager.refreshWorkspaceClassInfo() re-registers a new instance of this class after each Gradle task run, which is the only point at which compiled workspace classes can change.

  • Constructor Details

    • WorkspaceLibraryInfo

      public WorkspaceLibraryInfo(Generator generator)
  • Method Details

    • refreshSourceLocation

      public void refreshSourceLocation()
      Attaches a fresh source location instance to this library. Workspace source files presented by code completion (javadoc, parameter names) are parsed on demand, but cached keyed on the source location instance identity, so a fresh instance makes code completion re-read them.
    • getSourceLocation

      public org.fife.rsta.ac.java.buildpath.SourceLocation getSourceLocation()
      Overrides:
      getSourceLocation in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • setSourceLocation

      public void setSourceLocation(org.fife.rsta.ac.java.buildpath.SourceLocation sourceLocation)
      Overrides:
      setSourceLocation in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • bulkClassFileCreationStart

      public void bulkClassFileCreationStart()
      Specified by:
      bulkClassFileCreationStart in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • bulkClassFileCreationEnd

      public void bulkClassFileCreationEnd()
      Specified by:
      bulkClassFileCreationEnd in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • compareTo

      public int compareTo(@Nonnull org.fife.rsta.ac.java.buildpath.LibraryInfo info)
      LibraryInfo#equals(Object) delegates to this method, and JarManager#addClassFileSource(LibraryInfo) uses equality to detect that a library is already registered. Matching on the classes directory makes any two instances over the same directory equal, so re-registering a fresh instance replaces (and thus re-indexes) the already registered entry instead of adding a duplicate one.
    • createClassFile

      public org.fife.rsta.ac.java.classreader.ClassFile createClassFile(String entryName) throws IOException
      Specified by:
      createClassFile in class org.fife.rsta.ac.java.buildpath.LibraryInfo
      Throws:
      IOException
    • createClassFileBulk

      public org.fife.rsta.ac.java.classreader.ClassFile createClassFileBulk(String entryName) throws IOException
      Specified by:
      createClassFileBulk in class org.fife.rsta.ac.java.buildpath.LibraryInfo
      Throws:
      IOException
    • createPackageMap

      public org.fife.rsta.ac.java.PackageMapNode createPackageMap()
      Specified by:
      createPackageMap in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • getLastModified

      public long getLastModified()
      Specified by:
      getLastModified in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • getLocationAsString

      public String getLocationAsString()
      Specified by:
      getLocationAsString in class org.fife.rsta.ac.java.buildpath.LibraryInfo
    • hashCodeImpl

      public int hashCodeImpl()
      Specified by:
      hashCodeImpl in class org.fife.rsta.ac.java.buildpath.LibraryInfo