@Test public void testGetExportFilters() throws Exception { ArrayList<String> filters = new ArrayList<>(); assertEquals(filters, ExportFilterManager.getExportFilters(Structure.class)); ExportFilterManager.registerExportFilterClass( TrivialGraphFormatExport.class, "TrivialGraphFormatExport"); filters.add("Trivial Graph Format"); assertEquals(filters, ExportFilterManager.getExportFilters(Structure.class)); }
public static List<String> getExportFilters(Class<?> forClass) { HashSet<String> extensions = new HashSet<>(); List<String> result = new ArrayList<>(); for (Class i = forClass; i != null; i = i.getSuperclass()) if (EXPORT_FILTER_NAMES.containsKey(i)) for (String f : EXPORT_FILTER_NAMES.get(i).keySet()) { if (EXPORT_FILTER_DESCRIPTIONS.get(i).containsKey(f)) { ExportFilterDescription descr = EXPORT_FILTER_DESCRIPTIONS.get(i).get(f); if (extensions.contains(descr.fileExtension())) continue; extensions.add(descr.fileExtension()); } result.add(f); } result.sort(String.CASE_INSENSITIVE_ORDER); return result; }
ExportFilterManager { public static List<String> getExportFilters(Class<?> forClass) { HashSet<String> extensions = new HashSet<>(); List<String> result = new ArrayList<>(); for (Class i = forClass; i != null; i = i.getSuperclass()) if (EXPORT_FILTER_NAMES.containsKey(i)) for (String f : EXPORT_FILTER_NAMES.get(i).keySet()) { if (EXPORT_FILTER_DESCRIPTIONS.get(i).containsKey(f)) { ExportFilterDescription descr = EXPORT_FILTER_DESCRIPTIONS.get(i).get(f); if (extensions.contains(descr.fileExtension())) continue; extensions.add(descr.fileExtension()); } result.add(f); } result.sort(String.CASE_INSENSITIVE_ORDER); return result; } }
ExportFilterManager { public static List<String> getExportFilters(Class<?> forClass) { HashSet<String> extensions = new HashSet<>(); List<String> result = new ArrayList<>(); for (Class i = forClass; i != null; i = i.getSuperclass()) if (EXPORT_FILTER_NAMES.containsKey(i)) for (String f : EXPORT_FILTER_NAMES.get(i).keySet()) { if (EXPORT_FILTER_DESCRIPTIONS.get(i).containsKey(f)) { ExportFilterDescription descr = EXPORT_FILTER_DESCRIPTIONS.get(i).get(f); if (extensions.contains(descr.fileExtension())) continue; extensions.add(descr.fileExtension()); } result.add(f); } result.sort(String.CASE_INSENSITIVE_ORDER); return result; } private  ExportFilterManager(); }
ExportFilterManager { public static List<String> getExportFilters(Class<?> forClass) { HashSet<String> extensions = new HashSet<>(); List<String> result = new ArrayList<>(); for (Class i = forClass; i != null; i = i.getSuperclass()) if (EXPORT_FILTER_NAMES.containsKey(i)) for (String f : EXPORT_FILTER_NAMES.get(i).keySet()) { if (EXPORT_FILTER_DESCRIPTIONS.get(i).containsKey(f)) { ExportFilterDescription descr = EXPORT_FILTER_DESCRIPTIONS.get(i).get(f); if (extensions.contains(descr.fileExtension())) continue; extensions.add(descr.fileExtension()); } result.add(f); } result.sort(String.CASE_INSENSITIVE_ORDER); return result; } private  ExportFilterManager(); static void registerExportFilterClass(Class<?> aClass,
                                                 String className); static List<String> getExportFilters(Class<?> forClass); static ExportFilter instantiateExportFilter(Class<?> forClass,
                                                       String identifier); static ExportFilter instantiateExportFilterByExtension(
            Class<?> forClass, String identifier); static ExportFilterDescription getExportFilterDescription(
            Class<?> forClass, String identifier); static void clear(); }
ExportFilterManager { public static List<String> getExportFilters(Class<?> forClass) { HashSet<String> extensions = new HashSet<>(); List<String> result = new ArrayList<>(); for (Class i = forClass; i != null; i = i.getSuperclass()) if (EXPORT_FILTER_NAMES.containsKey(i)) for (String f : EXPORT_FILTER_NAMES.get(i).keySet()) { if (EXPORT_FILTER_DESCRIPTIONS.get(i).containsKey(f)) { ExportFilterDescription descr = EXPORT_FILTER_DESCRIPTIONS.get(i).get(f); if (extensions.contains(descr.fileExtension())) continue; extensions.add(descr.fileExtension()); } result.add(f); } result.sort(String.CASE_INSENSITIVE_ORDER); return result; } private  ExportFilterManager(); static void registerExportFilterClass(Class<?> aClass,
                                                 String className); static List<String> getExportFilters(Class<?> forClass); static ExportFilter instantiateExportFilter(Class<?> forClass,
                                                       String identifier); static ExportFilter instantiateExportFilterByExtension(
            Class<?> forClass, String identifier); static ExportFilterDescription getExportFilterDescription(
            Class<?> forClass, String identifier); static void clear();  }