Class ZipSourceLocation
java.lang.Object
org.fife.rsta.ac.java.buildpath.ZipSourceLocation
- All Implemented Interfaces:
SourceLocation
Represents source inside a zip or jar file. The source can be either in
a "
src/" subfolder, or at the root level of the archive. This
class is useful for the JDK or other libraries that come with a
src.zip file (src.jar on OS X).- Version:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionZipSourceLocation(File archive) Constructor.ZipSourceLocation(String archive) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns an AST for the specified class file.Returns a string representation of this source location.
-
Field Details
-
archive
-
-
Constructor Details
-
ZipSourceLocation
Constructor.- Parameters:
archive- The archive containing the source. This should be an absolute path to ensure correctness.
-
ZipSourceLocation
Constructor.- Parameters:
archive- The archive containing the source.
-
-
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. - Throws:
IOException- If an IO error occurs.
-
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.
-