- From: Julien Grand-Mourcel via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 13 Sep 2007 10:10:49 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties In directory hutz:/tmp/cvs-serv23835/org/w3c/css/properties Modified Files: PropertiesLoader.java Log Message: Adding a new method which returns the sorted list of profile to check against when default profile is selected Index: PropertiesLoader.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/PropertiesLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PropertiesLoader.java 14 Sep 2005 15:14:18 -0000 1.2 +++ PropertiesLoader.java 13 Sep 2007 10:10:47 -0000 1.3 @@ -8,7 +8,10 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; import java.util.Hashtable; +import java.util.Iterator; import org.w3c.css.util.Utf8Properties; import org.w3c.css.util.Util; @@ -104,6 +107,31 @@ return result; } } + + /** + * This method returns the profile to check against + * when no special profile is specified + * This function is used in CssPropertyFactory + * @return the sorted list of profiles as a string array + */ + public static String[] getProfiles() { + //initializations + Iterator it = profiles.keySet().iterator(); + + ArrayList res = new ArrayList(); + String profil; + + while (it.hasNext()) { + // we filtered only the profiles that we're interessted in + profil = it.next().toString(); + if (profil.startsWith("css")) + res.add(profil); + } + // we sort them + Collections.sort(res); + // return them as an array + return (String[]) res.toArray(new String[res.size()]); + } static { config = new Utf8Properties();
Received on Thursday, 13 September 2007 10:10:51 UTC