public String listReaderOptions(IChemFormat format) { if (format.getReaderClassName() == null) return "No reader avaiable for this format"; IChemObjectReader reader = readerFactory.createReader(format); if (reader == null) return "Cannot instantiate writer: " + format.getReaderClassName(); IOSetting[] settings = reader.getIOSettings(); if (settings == null || settings.length == 0) return "The reader does not have options"; StringBuffer overview = new StringBuffer(); for (String _ : new String[] { format.getFormatName(), JsConsoleView.NEWLINE }) overview.append(_); for (IOSetting setting : settings) { for (String _ : new String[] { "[", setting.getName(), "]", JsConsoleView.NEWLINE, setting.getQuestion(), JsConsoleView.NEWLINE, "Default value: ", setting.getDefaultSetting(), JsConsoleView.NEWLINE, "Value : ", setting.getSetting(), JsConsoleView.NEWLINE}) overview.append(_); } return overview.toString(); }
public void processIOSettingQuestion(IOSetting setting) { if (setting.getName().equals(forceReadAs3DCoords.getName())) { try { setting.setSetting(forceReadAs3DCoords.getSetting()); } catch (CDKException e) { logger.debug("Could not propagate forceReadAs3DCoords setting"); } } }
@Test public void testGetIOSetting() { IOSetting[] settings = chemObjectIO.getIOSettings(); for (IOSetting setting : settings) { Assert.assertNotNull(setting); Assert.assertNotNull(setting.getDefaultSetting()); Assert.assertNotNull(setting.getName()); Assert.assertNotNull(setting.getQuestion()); Assert.assertNotNull(setting.getLevel()); } }