@Test public void testLEDAExport() throws Exception { PluginManager.registerClass(LEDAExport.class); ByteArrayOutputStream result = new ByteArrayOutputStream(); OutputStreamWriter out = new OutputStreamWriter(result); ExportFilterManager.instantiateExportFilterByExtension(DirectedGraph.class, "lgr") .exportGraph(getTestStructure(), out, null); out.flush(); assertThat(result.toString(), startsWith("LEDA.GRAPH\n")); }
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();  }