Package org.fife.rsta.ac.java.buildpath
Class ClasspathSourceLocation
- java.lang.Object
-
- org.fife.rsta.ac.java.buildpath.ClasspathSourceLocation
-
- All Implemented Interfaces:
SourceLocation
public class ClasspathSourceLocation extends java.lang.Object implements SourceLocation
Represents Java source files somewhere on the classpath. This might be somewhat of a unique situation, since often source isn't on the classpath, only class files are. However, there may be times when you want to ship both the classes and source for a library and put them on your classpath for simplicity of integrating with this code completion library. In such a case, you would use aClasspathLibraryInfoand use this class for the source location.This class has no state; any classes it's asked about, it assumes it can find the corresponding .java file somewhere on the classpath using the class's ClassLoader.
- Version:
- 1.0
- See Also:
ClasspathLibraryInfo
-
-
Constructor Summary
Constructors Constructor Description ClasspathSourceLocation()
-
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)
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.
-
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.
-
-