View Javadoc

1   package org.codehaus.mojo.properties;
2   
3   import java.util.Collections;
4   import java.util.Enumeration;
5   import java.util.Properties;
6   import java.util.Vector;
7   
8   public class SortedProperties extends Properties {
9   
10  	/**
11  	 * 
12  	 */
13  	private static final long serialVersionUID = 1330825236411537386L;
14  
15  	@SuppressWarnings({ "rawtypes", "unchecked" })
16  	@Override
17  	public synchronized Enumeration<Object> keys() {
18  		Enumeration keysEnum = super.keys();
19  		Vector keyList = new Vector();
20  		while (keysEnum.hasMoreElements()) {
21  			keyList.add(keysEnum.nextElement());
22  		}
23  		Collections.sort(keyList);
24  		return keyList.elements();
25  	}
26  
27  }