Class DirSourceLocation

java.lang.Object
org.fife.rsta.ac.java.buildpath.DirSourceLocation
All Implemented Interfaces:
SourceLocation

public class DirSourceLocation extends Object implements SourceLocation
Represents Java source in a directory, such as in a project's source folder.
Version:
1.0
  • Field Details

    • dir

      private File dir
  • Constructor Details

    • DirSourceLocation

      public DirSourceLocation(String dir)
      Constructor.
      Parameters:
      dir - The directory containing the source files.
    • DirSourceLocation

      public DirSourceLocation(File dir)
      Constructor.
      Parameters:
      dir - The directory containing the source files.
  • Method Details

    • getCompilationUnit

      public CompilationUnit getCompilationUnit(ClassFile cf) throws IOException
      Returns an AST for the specified class file.
      Specified by:
      getCompilationUnit in interface SourceLocation
      Parameters:
      cf - The class file to grab the AST for.
      Returns:
      The AST, or null if it cannot be found.
      Throws:
      IOException - If an IO error occurs.
    • getLocationAsString

      public String getLocationAsString()
      Returns a string representation of this source location. For locations on disk such as zip files or directories, this should be the full path to the resource.
      Specified by:
      getLocationAsString in interface SourceLocation
      Returns:
      The location of this source as a string, or null if it is not an accessible location.