MDLRXNWriter extends DefaultChemObjectWriter { @Override public boolean accepts(Class<? extends IChemObject> classObject) { if (IReaction.class.equals(classObject)) return true; if (IReactionSet.class.equals(classObject)) return true; Class<?>[] interfaces = classObject.getInterfaces(); for (Class<?> anInterface : interfaces) { if (IReaction.class.equals(anInterface)) return true; if (IReactionSet.class.equals(anInterface)) return true; } Class superClass = classObject.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } MDLRXNWriter(Writer out);  MDLRXNWriter(OutputStream output);  MDLRXNWriter(); @Override IResourceFormat getFormat(); @Override void setWriter(Writer out); @Override void setWriter(OutputStream output); void setRdFields(Map<String, Object> map); @Override void close(); @Override boolean accepts(Class<? extends IChemObject> classObject); @Override void write(IChemObject object); public Map<String, Object> rdFields; }
@Test public void testAccepts() throws Exception { MDLRXNWriter reader = new MDLRXNWriter(); Assert.assertTrue(reader.accepts(Reaction.class)); }