public class JarLibraryInfo extends LibraryInfo
DirLibraryInfo,
ClasspathLibraryInfo| Constructor and Description |
|---|
JarLibraryInfo(java.io.File jarFile) |
JarLibraryInfo(java.io.File jarFile,
SourceLocation sourceLoc) |
JarLibraryInfo(java.lang.String jarFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
bulkClassFileCreationEnd()
Does any cleanup necessary after a call to
LibraryInfo.bulkClassFileCreationStart(). |
void |
bulkClassFileCreationStart()
Readies this library for many class files being fetched via
LibraryInfo.createClassFileBulk(String). |
int |
compareTo(LibraryInfo info)
Compares this
LibraryInfo to another one. |
ClassFile |
createClassFile(java.lang.String entryName)
Returns the class file information for the specified class.
|
ClassFile |
createClassFileBulk(java.lang.String entryName)
Returns the class file information for the specified class.
|
PackageMapNode |
createPackageMap()
Creates and returns a map of maps representing the hierarchical package
structure in this library.
|
java.io.File |
getJarFile()
Returns the jar file this instance is wrapping.
|
long |
getLastModified()
Returns the time this library was last modified.
|
java.lang.String |
getLocationAsString()
Returns the location of this library, as a string.
|
int |
hashCode()
Subclasses should override this method since
LibraryInfo.equals(Object) is
overridden. |
java.lang.String |
toString()
Returns a string representation of this jar information.
|
clone, equals, getJreJarInfo, getMainJreJarInfo, getSourceLocation, setSourceLocationpublic JarLibraryInfo(java.lang.String jarFile)
public JarLibraryInfo(java.io.File jarFile)
public JarLibraryInfo(java.io.File jarFile,
SourceLocation sourceLoc)
public void bulkClassFileCreationEnd()
LibraryInfoLibraryInfo.bulkClassFileCreationStart().bulkClassFileCreationEnd in class LibraryInfoLibraryInfo.bulkClassFileCreationStart(),
LibraryInfo.createClassFileBulk(String)public void bulkClassFileCreationStart()
LibraryInfoLibraryInfo.createClassFileBulk(String). After calling this method,
the actual class file fetching should be done in a try/finally block
that ensures a call to LibraryInfo.bulkClassFileCreationEnd(); e.g.
libInfo.bulkClassFileCreationStart();
try {
String entryName = ...;
ClassFile cf = createClassFileBulk(entryName);
...
} finally {
libInfo.bulkClassFileCreationEnd();
}
bulkClassFileCreationStart in class LibraryInfoLibraryInfo.bulkClassFileCreationEnd(),
LibraryInfo.createClassFileBulk(String)public int compareTo(LibraryInfo info)
LibraryInfo to another one. Two instances of
this class are only considered equal if they represent the same class
file location. Source attachment is irrelevant.public ClassFile createClassFile(java.lang.String entryName) throws java.io.IOException
LibraryInfoJarReader can call this method to lazily load
information on individual classes and shove it into their package maps.
If many class files will be fetched at a time, you should prefer using
LibraryInfo.bulkClassFileCreationStart() and
LibraryInfo.createClassFileBulk(String) over this method, for performance
reasons.
createClassFile in class LibraryInfoentryName - The fully qualified name of the class file.null if it isn't found in this
library.java.io.IOException - If an IO error occurs.LibraryInfo.createClassFileBulk(String)public ClassFile createClassFileBulk(java.lang.String entryName) throws java.io.IOException
LibraryInfoJarReader can call this method to lazily load
information on individual classes and shove it into their package maps.
This method should be used when multiple classes will be fetched from
this library at the same time. It should only be called after a call to
LibraryInfo.bulkClassFileCreationStart(). If only a single class file is
being fetched, it is simpler to call LibraryInfo.createClassFile(String).
createClassFileBulk in class LibraryInfoentryName - The fully qualified name of the class file.null if it isn't found in this
library.java.io.IOException - If an IO error occurs.LibraryInfo.createClassFile(String)public PackageMapNode createPackageMap() throws java.io.IOException
LibraryInfocreatePackageMap in class LibraryInfojava.io.IOException - If an IO error occurs.public long getLastModified()
LibraryInfoThis API may change in the future.
getLastModified in class LibraryInfopublic java.lang.String getLocationAsString()
LibraryInfonull.getLocationAsString in class LibraryInfopublic java.io.File getJarFile()
public int hashCode()
LibraryInfoLibraryInfo.equals(Object) is
overridden. Instances of LibraryInfo aren't typically
stored in maps, so the hash value isn't necessarily important to
RSTALanguageSupport.hashCode in class LibraryInfopublic java.lang.String toString()
toString in class java.lang.Object