@Test public void testInstantiateExportFilterByExtension() throws Exception { PluginManager.registerClass(TrivialGraphFormatExport.class); assertThat(ExportFilterManager.instantiateExportFilterByExtension(Structure.class, "tgf"), instanceOf(TrivialGraphFormatExport.class)); assertEquals(null, ExportFilterManager.instantiateExportFilterByExtension(Structure.class, "xyz")); assertEquals(null, ExportFilterManager.instantiateExportFilterByExtension(Structure.class, "")); }
public static ExportFilter instantiateExportFilterByExtension( Class<?> forClass, String identifier) throws Exception { for (Class c = forClass; c != null; c = c.getSuperclass()) if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) { HashMap<String, String> filters = EXPORT_FILTER_EXTENSIONS.get(c); if (filters.containsKey(identifier)) return (ExportFilter) instantiateClass(filters.get(identifier)); } return null; }
ExportFilterManager { public static ExportFilter instantiateExportFilterByExtension( Class<?> forClass, String identifier) throws Exception { for (Class c = forClass; c != null; c = c.getSuperclass()) if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) { HashMap<String, String> filters = EXPORT_FILTER_EXTENSIONS.get(c); if (filters.containsKey(identifier)) return (ExportFilter) instantiateClass(filters.get(identifier)); } return null; } }
ExportFilterManager { public static ExportFilter instantiateExportFilterByExtension( Class<?> forClass, String identifier) throws Exception { for (Class c = forClass; c != null; c = c.getSuperclass()) if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) { HashMap<String, String> filters = EXPORT_FILTER_EXTENSIONS.get(c); if (filters.containsKey(identifier)) return (ExportFilter) instantiateClass(filters.get(identifier)); } return null; } private  ExportFilterManager(); }
ExportFilterManager { public static ExportFilter instantiateExportFilterByExtension( Class<?> forClass, String identifier) throws Exception { for (Class c = forClass; c != null; c = c.getSuperclass()) if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) { HashMap<String, String> filters = EXPORT_FILTER_EXTENSIONS.get(c); if (filters.containsKey(identifier)) return (ExportFilter) instantiateClass(filters.get(identifier)); } return null; } 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 ExportFilter instantiateExportFilterByExtension( Class<?> forClass, String identifier) throws Exception { for (Class c = forClass; c != null; c = c.getSuperclass()) if (EXPORT_FILTER_EXTENSIONS.containsKey(c)) { HashMap<String, String> filters = EXPORT_FILTER_EXTENSIONS.get(c); if (filters.containsKey(identifier)) return (ExportFilter) instantiateClass(filters.get(identifier)); } return null; } 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();  }