Class ClasspathSourceLocation
java.lang.Object
org.fife.rsta.ac.java.buildpath.ClasspathSourceLocation
- All Implemented Interfaces:
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 a
ClasspathLibraryInfo and 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an AST for the specified class file.Returns a string representation of this source location.
-
Constructor Details
-
ClasspathSourceLocation
public ClasspathSourceLocation()
-
-
Method Details
-
getCompilationUnit
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
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.
-