Package org.fife.rsta.ac.java.buildpath
Class DirSourceLocation
- java.lang.Object
-
- org.fife.rsta.ac.java.buildpath.DirSourceLocation
-
- All Implemented Interfaces:
SourceLocation
public class DirSourceLocation extends java.lang.Object implements SourceLocation
Represents Java source in a directory, such as in a project's source folder.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Filedir
-
Constructor Summary
Constructors Constructor Description DirSourceLocation(java.io.File dir)Constructor.DirSourceLocation(java.lang.String dir)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompilationUnitgetCompilationUnit(ClassFile cf)Returns an AST for the specified class file.java.lang.StringgetLocationAsString()Returns a string representation of this source location.
-
-
-
Method Detail
-
getCompilationUnit
public CompilationUnit getCompilationUnit(ClassFile cf) throws java.io.IOException
Returns an AST for the specified class file.- Specified by:
getCompilationUnitin interfaceSourceLocation- Parameters:
cf- The class file to grab the AST for.- Returns:
- The AST, or
nullif it cannot be found. - Throws:
java.io.IOException- If an IO error occurs.
-
getLocationAsString
public java.lang.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:
getLocationAsStringin interfaceSourceLocation- Returns:
- The location of this source as a string, or
nullif it is not an accessible location.
-
-