/*
- * jSite - Configuration.java - Copyright © 2006–2011 David Roden
+ * jSite - Configuration.java - Copyright © 2006–2012 David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
/* load last insert hashes. */
+ Map<String, FileOption> fileOptions = new HashMap<String, FileOption>();
SimpleXML lastInsertHashesNode = projectNode.getNode("last-insert-hashes");
if (lastInsertHashesNode != null) {
for (SimpleXML fileNode : lastInsertHashesNode.getNodes("file")) {
String filename = fileNode.getNode("filename").getValue();
String lastInsertHash = fileNode.getNode("last-insert-hash").getValue();
int lastInsertEdition = Integer.valueOf(fileNode.getNode("last-insert-edition").getValue());
- project.getFileOption(filename).setLastInsertHash(lastInsertHash).setLastInsertEdition(lastInsertEdition);
+ FileOption fileOption = project.getFileOption(filename);
+ fileOption.setLastInsertHash(lastInsertHash).setLastInsertEdition(lastInsertEdition);
+ fileOptions.put(filename, fileOption);
}
}
SimpleXML fileOptionsNode = projectNode.getNode("file-options");
- Map<String, FileOption> fileOptions = new HashMap<String, FileOption>();
if (fileOptionsNode != null) {
SimpleXML[] fileOptionNodes = fileOptionsNode.getNodes("file-option");
for (SimpleXML fileOptionNode : fileOptionNodes) {
}
}
+ /**
+ * Returns whether to use the “early encode“ flag for the insert.
+ *
+ * @return {@code true} to set the “early encode” flag for the insert,
+ * {@code false} otherwise
+ */
+ public boolean useEarlyEncode() {
+ return getNodeBooleanValue(new String[] { "use-early-encode" }, false);
+ }
+
+ /**
+ * Sets whether to use the “early encode“ flag for the insert.
+ *
+ * @param useEarlyEncode
+ * {@code true} to set the “early encode” flag for the insert,
+ * {@code false} otherwise
+ * @return This configuration
+ */
+ public Configuration setUseEarlyEncode(boolean useEarlyEncode) {
+ rootNode.replace("use-early-encode", String.valueOf(useEarlyEncode));
+ return this;
+ }
+
}