How to set IOSettings on cdk Readers

So I wanted to set readConnect and useRebondTool to false on the org.openscience.cdk.io.PDBReader.

Turns out, the way to do this is:
PDBReader reader = new PDBReader(new FileReader(input));
Properties properties = new Properties();
properties.setProperty("ReadConnectSection", "false");
properties.setProperty("UseRebondTool", "false");
PropertiesListener listener =
new PropertiesListener(properties);
reader.addChemObjectIOListener(listener);
reader.customizeJob();
Hmm. Not so easy. Maybe reflection in the base DefaultChemObjectReader class could allow the Readers to have set(String propertyName, String value) methods?

Comments

There are a few use cases where IO settings are important. An original one is the ask the user about IO setting when the file is saved. Another option is to have user settings, for example, in the Eclipse properties window.

The use case of ask questions upon "Save" was the reason why a listener approach was used.

There is a paper in a CDK News (http://www.cdknews.org/) that describes the listener model in more detail.
gilleain said…
Well, I understood that the original use case was to pop up dialogs and so on, I guess that programmatic setting of these properties doesn't happen very often.