?? cacheconfig.java
字號:
package cn.hxex.exam.config;
import java.util.List;
import java.util.Properties;
import java.util.Vector;
/**
* 與配置文件中cache元素相對應的配置對象
* 它是依據配置文件中的cache元素來生成的,
* 是配置文件中cache元素的Java對象表現形式
*
* @author galaxy
*
*/
public class CacheConfig
{
private List<Property> properties;
private String type;
/**
* @return Returns the type.
*/
public String getType()
{
return type;
}
/**
* @param type The type to set.
*/
public void setType(String type)
{
this.type = type;
}
/**
* 增加Cache初始化參數對象
*
* @param property 初始化參數對象
*/
public void addProperty(Property property)
{
if (properties == null)
properties = new Vector<Property>();
properties.add(property);
}
/**
* 返回所有的初始化配置參數
* @return 配置文件中配置的初始化配置參數
*/
public Properties getProperties()
{
if (properties == null)
return new Properties();
// 將初始化參數轉換為Java標準的屬性類
Properties props = new Properties();
for (Property property : properties)
{
props.put(property.getName(), property.getValue());
}
return props;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -