添加工具类:
package utils;
import java.util.*;
import java.io.*;
@SuppressWarnings({"serial","rawtypes","unchecked"})
public class OrderedProperties extends java.util.Properties {
public ArrayList orderedKeys = new ArrayList();
public OrderedProperties() {
super();
}
public OrderedProperties(java.util.Properties defaults) {
super(defaults);
}
public synchronized Iterator getKeysIterator() {
return orderedKeys.iterator();
}
public static OrderedProperties load(String name)
throws IOException {
OrderedProperties props = null;
java.io.InputStream is =
OrderedProperties.class.getResourceAsStream(name);
if ( is != null ) {
props = new OrderedProperties();
props.load(is);
return props;
} else {
if ( ! name.startsWith("/") ) {
return load("/" + name);
} else {
throw new IOException("Properties could not