Methods Summary |
---|
private static void | checkLegalAlias(java.lang.String aliasName)
if ( ! isValidAlias( aliasName ) )
{
throw new IllegalArgumentException( "illegal alias name: \"" + aliasName + "\"");
}
|
public void | createAlias(java.lang.String aliasName, java.lang.String objectName)
checkLegalAlias( aliasName );
if ( resolveAlias( aliasName ) != null )
{
// illegal to create an already-existing alias
throw new IllegalArgumentException( "alias already exists: " + aliasName );
}
mImpl.create( aliasName, objectName );
|
public void | deleteAlias(java.lang.String aliasName)
checkLegalAlias( aliasName );
mImpl.delete( aliasName );
|
public java.lang.String[] | getAliases()
return( listAliases( ) );
|
public static boolean | isValidAlias(java.lang.String str)
final int strLength = str.length();
boolean isValid = strLength != 0;
if ( isValid )
{
// this can be done more efficiently with a BitMap or Set, but who cares
for( int i = 0; i < strLength; ++i )
{
final char theChar = str.charAt( i );
if ( ! LegalAliasChars.isLegalAliasChar( theChar ) )
{
isValid = false;
break;
}
}
}
return( isValid );
|
public java.lang.String[] | listAliases()
return( listAliases( false ) );
|
public java.lang.String[] | listAliases(boolean showValues)
final Set keys = mImpl.getNames();
final int numKeys = keys.size();
final String [] aliases = new String[ numKeys ];
final Iterator iter = keys.iterator();
for( int i = 0; i < numKeys; ++i )
{
final String key = (String)iter.next();
if ( showValues )
{
aliases[ i ] = key + "=" + resolveAlias( key );
}
else
{
aliases[ i ] = key;
}
}
Arrays.sort( aliases );
return( aliases );
|
public java.lang.String | resolveAlias(java.lang.String aliasName)
checkLegalAlias( aliasName );
final String result = (String)mImpl.get( aliasName );
return( result );
|