public class FileRepository extends java.lang.Object implements Repository
FileRepository class implements a simple repository
for sidl symbols using XML files stored in a single root directory.
Each symbol is mapped to a file in that directory of the generic form
NAME-vVERSION.xml, where NAME and VERSION are taken from the symbol
identifier. This class does not cache the symbols in the file repository
directory because external writers may change the repository.| Constructor and Description |
|---|
FileRepository(java.lang.String repository,
Context context)
The constructor takes a file directory path to the repository.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Set |
getAllSymbols()
Retrieve all symbols currently in the repository.
|
Symbol |
lookupSymbol(java.lang.String fqn)
Look up a symbol based on the fully qualified name and retrieve the
most recent version that matches the symbol name.
|
Symbol |
lookupSymbol(SymbolID id)
Look up the symbol based on the fully qualified name and version in
the file repository.
|
void |
writeSymbols(java.util.Set symbol_names)
Write the symbols in the
Set from the symbol table to
the file repository. |
public FileRepository(java.lang.String repository,
Context context)
throws RepositoryException
RepositoryExceptionpublic Symbol lookupSymbol(SymbolID id)
lookupSymbol in interface SymbolResolverpublic Symbol lookupSymbol(java.lang.String fqn)
lookupSymbol in interface SymbolResolverpublic java.util.Set getAllSymbols()
Set in which each set element is an object
of type SymbolID. The return argument will not be null
but may contain no objects.public void writeSymbols(java.util.Set symbol_names)
throws RepositoryException
Set from the symbol table to
the file repository. Each set entry is a SymbolID of
the symbol to be written.writeSymbols in interface SymbolWriterRepositoryExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object