Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ExampleUsage1()
- {
- File file = new File("settings.x39");
- ISettingsFileHandler handler = new SettingsFileHandler_1_0(file);
- SettingsDocument doc = null;
- try {
- doc = handler.load();
- } catch (ExceptionSettingsParsing e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- if(doc == null)
- return;
- SettingsNode rootNode = doc.getRootNode();
- for(SettingsNode node : rootNode.getChilds())
- {
- System.out.println(node.getName() + "[" + node.getChilds().length + "]:");
- for(SettingsOption opt : node.boundOptions)
- {
- System.out.println("\t" + opt.getName() + " " + opt.getValue());
- }
- }
- SettingsNode node1_1 = new SettingsNode("Node1.2");
- node1_1.boundOptions.add(new SettingsOption("Option1", "value1"));
- node1_1.boundOptions.add(new SettingsOption("Option2", "value2"));
- SettingsNode node1_2 = new SettingsNode("Node1.1");
- node1_2.boundOptions.add(new SettingsOption("Option1", "value1"));
- node1_2.boundOptions.add(new SettingsOption("Option2", "value2"));
- SettingsNode node = new SettingsNode("Node1");
- node.addChild(node1_1, node1_2);
- node.boundOptions.add(new SettingsOption("Option1", "value1"));
- node.boundOptions.add(new SettingsOption("Option2", "value2"));
- rootNode.addChild(node);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement