@Override protected void loadChilds(Device device, Preferences deviceNode) throws BackingStoreException { if (!deviceNode.nodeExists("dcmImageWriterFactory")) return; Preferences prefs = deviceNode.node("dcmImageWriterFactory"); ImageWriterFactory factory = new ImageWriterFactory(); for (String tsuid : prefs.childrenNames()) factory.put(tsuid, load(prefs.node(tsuid))); }
private void storeDiffs( Preferences prefs, ImageWriterFactory prevFactory, ImageWriterFactory factory) throws BackingStoreException { for (Entry<String, ImageWriterParam> entry : prevFactory.getEntries()) { String tsuid = entry.getKey(); if (factory.get(tsuid) == null) { Preferences node = prefs.node(tsuid); node.removeNode(); node.flush(); } } for (Entry<String, ImageWriterParam> entry : factory.getEntries()) { String tsuid = entry.getKey(); storeDiffs(prefs.node(tsuid), prevFactory.get(tsuid), entry.getValue()); } }
private void storeTo(ImageWriterFactory factory, Preferences prefs) { for (Entry<String, ImageWriterParam> entry : factory.getEntries()) storeTo(entry.getValue(), prefs.node(entry.getKey())); }