FileDocCategorySizeDatePackage
Configuration.javaAPI DocJ2ME MIDP 2.02446Thu Nov 07 12:02:26 GMT 2002com.sun.midp.main

Configuration

public class Configuration extends Object
access the implementation configuration file parameters.

Fields Summary
Constructors Summary
private Configuration()
Don't let anyone instantiate this class

    
Methods Summary
public static java.lang.StringgetProperty(java.lang.String key)
Gets the implementation property indicated by the specified key.

param
key the name of the implementation property.
return
the string value of the implementation property, or null if there is no property with that key.
exception
NullPointerException if key is null.
exception
IllegalArgumentException if key is empty.

	// If key is null, then a NullPointerException is thrown.
	// If key is blank, then throw a specific IllegalArgumentException
        if (key.length() ==  0) {
            throw new IllegalArgumentException("key can't be empty");
        }
        return getProperty0(key);
    
private static native java.lang.StringgetProperty0(java.lang.String key)
native interface to the configuration parameter storage.

param
key the name of the implementation property.
return
the string value of the implementation property, or null if there is no property with that key.

public static java.lang.StringgetPropertyDefault(java.lang.String key, java.lang.String def)
Gets the implementation property indicated by the specified key or returns the specifid default value.

param
key the name of the implementation property.
param
def the default value for the property if not specified in the configuration files or command line over rides.
return
the string value of the implementation property, or null if there is no property with that key.
exception
NullPointerException if key is null.
exception
IllegalArgumentException if key is empty.

	String result = getProperty(key);

	return (result != null ? result : def);