⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configuration.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/** * * @(#)Configuration.java	1.3 01/05/15 * * Copyright 2001 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. */package com.sun.midp;/** access the implementation configuration file parameters. */public class Configuration {    /** Don't let anyone instantiate this class */    private Configuration() {    }    /**     * 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 <code>null</code> if there is no property with that key.     *     * @exception  NullPointerException if <code>key</code> is     *             <code>null</code>.     * @exception  IllegalArgumentException if <code>key</code> is empty.     */    public static String getProperty(String key) {	// 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);    }    /**     * 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 <code>null</code> if there is no property with that key.     *     * @exception  NullPointerException if <code>key</code> is     *             <code>null</code>.     * @exception  IllegalArgumentException if <code>key</code> is empty.     */    public static String getPropertyDefault(String key, String def) {	String result = getProperty(key);	return (result != null ? result : def);    }    /**     * native interface to the configuration parameter storage.     *     * @param      key   the name of the implementation property.     * @return     the string value of the implementation property,     *             or <code>null</code> if there is no property with that key.     */    private native static String getProperty0(String key);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -