public class AliasManager
extends java.lang.Object
Constructor and Description |
---|
AliasManager()
Creates a new AliasManager, populating it with
default Aliases.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlias(Alias alias)
Adds an Alias, replacing any previous entries with the
same name.
|
Alias |
getAlias(java.lang.String aliasName)
Returns the Alias with the specified name
|
java.util.Set |
getAliases()
Returns a Set that is a snapshot of the Alias list.
|
void |
loadFromProperties(java.util.Properties properties)
Loads Aliases from a java.util.Properties file located at the
specified URL.
|
void |
removeAlias(java.lang.String aliasName)
Removes the Alias with the specified name from the AliasManager.
|
public AliasManager()
public void loadFromProperties(java.util.Properties properties)
[alias name]=[fully qualified classname]
each of which may have an optional
[alias name].desc=[alias description]
For example, to create an alias called "myprog
" for
class com.mydomain.myapp.MyProg
, the following properties
would be defined:
myprog=com.mydomain.myapp.MyProg
myprog.desc=Runs my program.
properties
- the Properties to load.public void addAlias(Alias alias)
alias
- the Alias to addpublic java.util.Set getAliases()
public void removeAlias(java.lang.String aliasName)
aliasName
- the name of the Alias to removepublic Alias getAlias(java.lang.String aliasName)
aliasName
- the name of the Alias to retrieve© 2004, Martian Software, Inc.