|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.hunsicker.jalopy.language.ClassRepository
Stores type names for Java packages. This information is needed in order to be able to switch between single-type-import declarations and type-import-on-demand declarations.
This class is thread-safe.
Method Summary | |
static ClassRepositoryEntry |
createEntry(ClassRepositoryEntry.Info info)
Creates a repository entry for the given repository info. |
ClassRepositoryEntry.Info |
get(java.io.File location)
Returns the repository info for the given location. |
java.lang.String[] |
getContent()
Returns the current contents of the repository. |
ClassRepositoryEntry.Info[] |
getInfo()
Returns the repository info (info about all registered entries). |
static ClassRepository |
getInstance()
Returns the sole instance of this class. |
int |
getSize()
Returns the current size of the repository. |
boolean |
isEmpty()
Indicates whether the repository is currently empty. |
void |
load(java.io.File location)
Loads the contents of the given location into memory. |
void |
loadAll(java.util.List locations)
Loads the contents of the given locations into memory. |
ClassRepositoryEntry.Info |
loadInfo(java.io.File file)
Loads the information from the given repository entry file. |
void |
unload(java.io.File location)
Unloads the given file from memory. |
void |
unloadAll(java.util.List locations)
Unloads the given locations from memory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ClassRepository getInstance()
public java.lang.String[] getContent()
null
.public boolean isEmpty()
true
if the repository is currently empty.public ClassRepositoryEntry.Info[] getInfo()
public int getSize()
public static ClassRepositoryEntry createEntry(ClassRepositoryEntry.Info info) throws java.io.IOException
info
- the information to create an entry upon.
null
if the location
info is no package root.
java.io.IOException
- if an I/O error occurred.
java.lang.IllegalArgumentException
- if the location specified in the info object does
not denote an existing file or directory.public ClassRepositoryEntry.Info get(java.io.File location)
location
- location to return the repository info for.
null
if no repository
file for the given location exists (i.e. the given location was not
registered yet).public void load(java.io.File location) throws java.io.IOException
If the given location is already registered, both persistent storage and memory will be updated. If the location denotes a Java archive (JAR) an update will only be performed if the archive actually changed.
Directories will always be updated as there is no easy way to detect changes in such a case. You should perform logic to avoid unnecessary loads in the Plug-in code.
If no entry exits for the location, a new entry will be generated and its contents loaded into memory.
location
- location to add.
java.io.IOException
- if an I/O error occured.public void loadAll(java.util.List locations) throws java.io.IOException
locations
- locations to add (of type <File>
).
java.io.IOException
- if an I/O error occurred.public ClassRepositoryEntry.Info loadInfo(java.io.File file) throws java.io.IOException
file
- the repository entry file.
java.io.IOException
- if an I/O error occurred.public void unload(java.io.File location) throws java.io.IOException
location
- location to unload.
java.io.IOException
- if an I/O error occurred.ClassRepositoryEntry.Info.getLocation()
public void unloadAll(java.util.List locations) throws java.io.IOException
locations
- locations to unload (of type <File>
).
java.io.IOException
- if an I/O error occurred.ClassRepositoryEntry.Info.getLocation()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |