use of org.syncany.plugins.transfer.TransferPluginOption in project syncany by syncany.
the class PluginOptionsTest method askNestedPluginSettings.
private void askNestedPluginSettings(TransferSettings settings, TransferPluginOption option, int wrap) throws Exception {
if (option instanceof NestedTransferPluginOption) {
assertNotNull(ReflectionUtil.getClassFromType(option.getType()));
System.out.println(new String(new char[wrap]).replace("\0", "\t") + ReflectionUtil.getClassFromType(option.getType()) + "#" + option.getField().getName() + " (nested)");
TransferSettings nestedSettings = (TransferSettings) ReflectionUtil.getClassFromType(option.getType()).newInstance();
settings.setField(option.getField().getName(), nestedSettings);
for (TransferPluginOption nItem : ((NestedTransferPluginOption) option).getOptions()) {
askNestedPluginSettings(nestedSettings, nItem, ++wrap);
}
} else {
System.out.println(new String(new char[wrap]).replace("\0", "\t") + settings.getClass() + "#" + option.getField().getName());
settings.setField(option.getField().getName(), String.valueOf(settings.hashCode()));
}
}
Aggregations