configurationreader.java

来自「这是一个以JAVA编写的程序,本人还没有试过,是一个简单的温度控制系统」· Java 代码 · 共 60 行

JAVA
60
字号
package net.sf.dz.util.wizard;import java.io.IOException;import java.io.File;import java.util.Map;/** * A configuration reader. * * <p> * * A bit of explanation is in order: why the API is so strange? Well, in * order to allow for flexibility. Here are the basic assumptions: * * <ul> * * <li> We know nothing of the configuration object that will be produced in *      {@link #read read()} call. * * <li> The context will contain values produced by the configuration wizard *      pages, and those values have to be cleared. * * <li> Total context cleanup is no good, however, because some data in the *      context may be a result of autodetection activities, therefore must *      be preserved - thus the need for a separate {@link #clear clear()} *      method. * * </ul> * * So, this API allows to produce a clean-cut configuration object and put * it into the context as a single value (not preventing the user from * cluttering it up as well, if they choose to do so). It also allows to * separate the configuration derived data from autodetected data. * * @author Copyright &copy; <a href="mailto:vt@freehold.crocodile.org">Vadim Tkachenko</a> 2004 * @version $Id: ConfigurationReader.java,v 1.2 2004/07/23 18:04:54 vtt Exp $ */public interface ConfigurationReader {    /**     * Read the configuration.     *     * @param cfFileName Name of the file to read the configuration from.     *     * @param context Context to put the configuration into.     *     * @param contextKey Key to associate the configuration object with.     *     * @exception IOException if there was a problem reading the configuration.     */    void read(File cfFileName, Map context, String contextKey) throws IOException;        /**     * Clear the context from the values that were rendered from the configuration.     *     * @param context Context to clear.     */    void clear(Map context);}

⌨️ 快捷键说明

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