static { CLASS_WHITELIST = new TreeSet<String>(); CLASS_WHITELIST.add("center"); CLASS_WHITELIST.add("top"); CLASS_WHITELIST.add("right"); CLASS_WHITELIST.add("bottom"); CLASS_WHITELIST.add("left"); }
private static String[] filterClasses(String[] classes) { Set<String> filteredClasses = new TreeSet<String>(); for (int i = 0; i < classes.length; i++) { if (CLASS_WHITELIST.contains(classes[i])) { filteredClasses.add(classes[i]); } } return filteredClasses.toArray(new String[filteredClasses.size()]); }