From: <cr...@us...> - 2008-07-25 14:03:16
|
Revision: 4354 http://jnode.svn.sourceforge.net/jnode/?rev=4354&view=rev Author: crawley Date: 2008-07-25 14:03:14 +0000 (Fri, 25 Jul 2008) Log Message: ----------- Fix bugs in handling of missing default values. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java Modified: trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java 2008-07-24 22:03:21 UTC (rev 4353) +++ trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java 2008-07-25 14:03:14 UTC (rev 4354) @@ -80,7 +80,8 @@ } else { sb.append(","); } - boolean isDefault = alternate.value.equals(defaultValue.getText()); + boolean isDefault = alternate.value.equals( + defaultValue == null ? "" : defaultValue.getText()); if (isDefault) { sb.append("["); } Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-24 22:03:21 UTC (rev 4353) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-25 14:03:14 UTC (rev 4354) @@ -329,18 +329,17 @@ } String description = child.getAttribute(DESCRIPTION, null); if (name == null) { - error( - "A '" + PROPERTY + "' element requires a '" + DESCRIPTION + - "' attribute", child); + error("A '" + PROPERTY + "' element requires a '" + DESCRIPTION + + "' attribute", child); } - String defaultValue = child.getAttribute(DEFAULT, null); + String defaultText = child.getAttribute(DEFAULT, null); PropertyType type = script.getTypes().get(typeName); if (type == null) { error("Use of undeclared type '" + typeName + "'", child); } - Value value = defaultValue == null ? null : type.fromValue(defaultValue); + Value defaultValue = (defaultText == null) ? null : type.fromValue(defaultText); try { - propSet.addProperty(name, type, description, value, child, stack.getLast() + propSet.addProperty(name, type, description, defaultValue, child, stack.getLast() .getFile()); } catch (ConfigureException ex) { addStack(ex, child); Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-24 22:03:21 UTC (rev 4353) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-25 14:03:14 UTC (rev 4354) @@ -135,8 +135,9 @@ // Harvest the properties to be written into a Properties Object Properties properties = new Properties(); for (Map.Entry<String, Property> entry : propSet.getProperties().entrySet()) { - Property prop = entry.getValue(); - properties.setProperty(entry.getKey(), prop.getValue().getText()); + PropertySet.Value propValue = entry.getValue().getValue(); + String text = (propValue == null) ? "" : propValue.getText(); + properties.setProperty(entry.getKey(), text); } OutputStream os = null; InputStream is = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-07-26 05:52:20
|
Revision: 4359 http://jnode.svn.sourceforge.net/jnode/?rev=4359&view=rev Author: crawley Date: 2008-07-26 05:52:17 +0000 (Sat, 26 Jul 2008) Log Message: ----------- More bug fixes + debug mode. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Configure.java trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java Modified: trunk/builder/src/configure/org/jnode/configure/Configure.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-07-25 21:09:31 UTC (rev 4358) +++ trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-07-26 05:52:17 UTC (rev 4359) @@ -57,7 +57,7 @@ private void run(String[] args) { try { parseArguments(args); - ConfigureScript script = new ScriptParser().loadScript(scriptFile); + ConfigureScript script = new ScriptParser(this).loadScript(scriptFile); for (PropertySet propFile : script.getPropsFiles()) { propFile.load(this); } @@ -123,6 +123,12 @@ format(err, message, DISPLAY_NORMAL); } + public void debug(String message) { + if (debug) { + format(err, message, DISPLAY_NORMAL); + } + } + private void format(PrintStream stream, String text, int displayAttributes) { switch (displayAttributes) { case DISPLAY_PROMPT: Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-25 21:09:31 UTC (rev 4358) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-26 05:52:17 UTC (rev 4359) @@ -137,12 +137,11 @@ } value = prop.getType().fromInput(input); if (value == null && input.length() == 0 && prop.hasDefaultValue()) { + configure.debug("Trying default"); value = prop.getDefaultValue(); } } while (value == null); - if (value != null) { - prop.setValue(value); - } + prop.setValue(value); } } } Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-25 21:09:31 UTC (rev 4358) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-26 05:52:17 UTC (rev 4359) @@ -121,7 +121,12 @@ } } - private LinkedList<ParseContext> stack = new LinkedList<ParseContext>(); + private final LinkedList<ParseContext> stack = new LinkedList<ParseContext>(); + private final Configure configure; + + public ScriptParser(Configure configure) { + this.configure = configure; + } public ConfigureScript loadScript(String fileName) throws ConfigureException { final File file = new File(fileName); @@ -338,6 +343,8 @@ error("Use of undeclared type '" + typeName + "'", child); } Value defaultValue = (defaultText == null) ? null : type.fromValue(defaultText); + configure.debug("Default value for " + name + " is " + + (defaultValue == null ? "null" : defaultValue.toString())); try { propSet.addProperty(name, type, description, defaultValue, child, stack.getLast() .getFile()); Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-25 21:09:31 UTC (rev 4358) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-26 05:52:17 UTC (rev 4359) @@ -98,7 +98,7 @@ try { if (!file.exists() && defaultFile != null) { if (defaultFile.exists()) { - configure.output("Taking initial values for the '" + file + + configure.debug("Taking initial values for the '" + file + "' properties from '" + defaultFile + "'."); file = defaultFile; } @@ -107,7 +107,7 @@ loadFromFile(properties, in); } catch (FileNotFoundException ex) { // Fall back to the builtin default property values - configure.output("Taking initial values for the '" + file + + configure.debug("Taking initial values for the '" + file + "' properties from the builtin defaults."); } catch (IOException ex) { throw new ConfigureException("Problem loading properties from '" + file + "'.", ex); @@ -125,20 +125,29 @@ String value = (String) properties.get(key); Property prop = propSet.getProperty((String) key); if (prop != null) { - PropertyType type = prop.getType(); - prop.setDefaultValue(type.fromValue(value)); + PropertySet.Value defaultValue = prop.getType().fromValue(value); + configure.debug("Setting default value for " + key + " to " + + (defaultValue == null ? "null" : defaultValue.toString())); + prop.setDefaultValue(defaultValue); } } } public void save(PropertySet propSet, Configure configure) throws ConfigureException { - // Harvest the properties to be written into a Properties Object + // Harvest the properties to be written into a temporary Properties Object Properties properties = new Properties(); for (Map.Entry<String, Property> entry : propSet.getProperties().entrySet()) { PropertySet.Value propValue = entry.getValue().getValue(); + if (propValue == null) { + configure.debug("Using default for unset property " + entry.getKey()); + propValue = entry.getValue().getDefaultValue(); + } String text = (propValue == null) ? "" : propValue.getText(); + configure.debug("Property " + entry.getKey() + " is \"" + text + "\""); properties.setProperty(entry.getKey(), text); } + // Output properties, either using the child class'es saveToFile method + // or by using the template expansion mechanism. OutputStream os = null; InputStream is = null; File toFile = propSet.getFile(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-07-28 13:38:54
|
Revision: 4364 http://jnode.svn.sourceforge.net/jnode/?rev=4364&view=rev Author: crawley Date: 2008-07-28 13:38:49 +0000 (Mon, 28 Jul 2008) Log Message: ----------- Property and type names are now restricted to alphanumerics, ".", "-" and "_". Changed the "name" attribute of "propFile" to "fileName". Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-28 13:23:06 UTC (rev 4363) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-28 13:38:49 UTC (rev 4364) @@ -125,6 +125,9 @@ for (Item item : items) { String text = item.getText(); if (text != null) { + if (text.endsWith("\n")) { + text = text.substring(0, text.length() - 1); + } configure.output(text); } PropertySet.Property prop = script.getProperty(item.getPropName()); @@ -142,6 +145,7 @@ } } while (value == null); prop.setValue(value); + configure.output(""); } } } Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-28 13:23:06 UTC (rev 4363) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-28 13:38:49 UTC (rev 4364) @@ -54,6 +54,7 @@ public static final String TYPE = "type"; public static final String CONTROL_PROPS = "controlProps"; public static final String PROP_FILE = "propFile"; + public static final String FILE_NAME = "fileName"; public static final String SCRIPT_FILE = "scriptFile"; public static final String DEFAULT_FILE = "defaultFile"; public static final String TEMPLATE_FILE = "templateFile"; @@ -78,9 +79,11 @@ public static final String VALUE_IS_NOT = "valueIsNot"; public static final String EMPTY_TOKEN = "emptyToken"; + public static final Pattern NAME_PATTERN = Pattern.compile("[a-zA-Z0-9.\\-_]+"); + + private static final Pattern LINE_SPLITTER_PATTERN = Pattern.compile("\r\n|\r(?!\n)|\n"); private static final String TAB_SPACES; - private static final Pattern LINE_SPLITTER = Pattern.compile("\r\n|\r(?!\n)|\n"); - + static { StringBuffer sb = new StringBuffer(Configure.TAB_WIDTH); for (int i = 0; i < Configure.TAB_WIDTH; i++) { @@ -225,6 +228,7 @@ private void parseType(XMLElement element, ConfigureScript script) throws ConfigureException { String name = element.getAttribute(NAME, null); + checkName(name, NAME, TYPE, element); String patternString = element.getAttribute(PATTERN, null); List<EnumeratedType.Alternate> alternates = new LinkedList<EnumeratedType.Alternate>(); for (Enumeration<?> en = element.enumerateChildren(); en.hasMoreElements(); /**/) { @@ -279,6 +283,18 @@ script.addType(type); } + private void checkName(String name, String attrName, String elementName, XMLElement element) + throws ConfigureException { + if (name == null) { + error("A '" + attrName + "' attribute is required for a '" + + elementName + "' element", element); + } + if (!NAME_PATTERN.matcher(name).matches()) { + error("This value (" + name + ") is not a valid value for a '" + + attrName + "' attribute", element); + } + } + private void parseControlProps(XMLElement element, ConfigureScript script) throws ConfigureException { PropertySet propSet = new PropertySet(script); @@ -288,9 +304,9 @@ private void parsePropsFile(XMLElement element, ConfigureScript script) throws ConfigureException { - String propFileName = element.getAttribute(NAME, null); + String propFileName = element.getAttribute(FILE_NAME, null); if (propFileName == null) { - error("A '" + PROP_FILE + "' element requires a '" + NAME + "' attribute", element); + error("A '" + PROP_FILE + "' element requires a '" + FILE_NAME + "' attribute", element); } File propFile = resolvePath(propFileName); String defaultPropFileName = element.getAttribute(DEFAULT_FILE, null); @@ -325,9 +341,7 @@ XMLElement child = (XMLElement) en.nextElement(); if (child.getName().equals(PROPERTY)) { String name = child.getAttribute(NAME, null); - if (name == null) { - error("A '" + PROPERTY + "' element requires a '" + NAME + "' attribute", child); - } + checkName(name, NAME, PROPERTY, child); String typeName = child.getAttribute(TYPE, null); if (name == null) { error("A '" + PROPERTY + "' element requires a '" + TYPE + "' attribute", child); @@ -426,7 +440,7 @@ if (content == null || content.length() == 0) { return content; } - String[] lines = LINE_SPLITTER.split(content, -1); + String[] lines = LINE_SPLITTER_PATTERN.split(content, -1); int minLeadingSpaces = Integer.MAX_VALUE; for (String line : lines) { int count, i; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-28 13:23:06 UTC (rev 4363) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-28 13:38:49 UTC (rev 4364) @@ -35,11 +35,14 @@ import java.io.OutputStreamWriter; import java.util.Map; import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.jnode.configure.Configure; import org.jnode.configure.ConfigureException; import org.jnode.configure.PropertySet; import org.jnode.configure.PropertyType; +import org.jnode.configure.ScriptParser; import org.jnode.configure.PropertySet.Property; /** @@ -60,6 +63,9 @@ private final ValueCodec codec; private final boolean loadSupported; private final boolean saveSupported; + + private static final Pattern AT_AT_CONTENTS_PATTERN = + Pattern.compile("(" + ScriptParser.NAME_PATTERN.pattern() + ")/?(\\W*)"); protected abstract void loadFromFile(Properties props, InputStream imput) throws IOException; @@ -202,8 +208,9 @@ * @throws IOException * @throws ConfigureException */ - private void expandToTemplate(Properties props, InputStream is, OutputStream os, char marker, - File file) throws IOException, ConfigureException { + private void expandToTemplate( + Properties props, InputStream is, OutputStream os, char marker, File file) + throws IOException, ConfigureException { int ch; int lineNo = 1; BufferedReader r = new BufferedReader(new InputStreamReader(is)); @@ -216,7 +223,8 @@ switch (ch) { case -1: throw new ConfigureException("Encountered EOF in a " + marker + - "..." + marker + " sequence"); + "..." + marker + " sequence: at " + file + + " line " + lineNo); case '\r': case '\n': throw new ConfigureException("Encountered end-of-line in a " + @@ -229,10 +237,16 @@ if (sb.length() == 0) { w.write(marker); } else { - String modifiers = removeModifiers(sb); - String propName = sb.toString(); - String propValue = props.getProperty(propName); - w.write(codec.encodeProperty(propName, propValue, modifiers)); + Matcher matcher = AT_AT_CONTENTS_PATTERN.matcher(sb); + if (!matcher.matches()) { + throw new ConfigureException("Malformed @...@ sequence: at " + file + + " line " + lineNo); + } + String name = matcher.group(1); + String modifiers = matcher.group(2); + modifiers = (modifiers == null) ? "" : modifiers; + String propValue = props.getProperty(name); + w.write(codec.encodeProperty(name, propValue, modifiers)); } } else { // FIXME ... make this aware of the host OS newline @@ -247,15 +261,4 @@ w.flush(); } } - - private String removeModifiers(StringBuffer sb) { - int index = sb.lastIndexOf("/"); - if (index >= 0) { - String modifiers = sb.substring(index + 1); - sb.setLength(index); - return modifiers; - } else { - return ""; - } - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-07-31 12:50:39
|
Revision: 4371 http://jnode.svn.sourceforge.net/jnode/?rev=4371&view=rev Author: crawley Date: 2008-07-31 12:50:34 +0000 (Thu, 31 Jul 2008) Log Message: ----------- Added the "changed" attribute to <item> which provides a message to be printed if the property value is changed. Tidied imports. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -35,11 +35,13 @@ private final ConfigureScript script; private final String propName; private final String text; + private final String changed; - public Item(ConfigureScript script, String propName, String text) { + public Item(ConfigureScript script, String propName, String text, String changed) { this.script = script; this.propName = propName; this.text = text; + this.changed = changed; } public ConfigureScript getScript() { @@ -53,6 +55,10 @@ public String getText() { return text; } + + public String getChanged() { + return changed; + } } private final String title; @@ -122,7 +128,9 @@ public void execute(Configure configure, ConfigureScript script) throws ConfigureException { configure.output(""); configure.output(title, Configure.DISPLAY_HIGHLIGHT); + // Process the items in order for (Item item : items) { + // Output the item text if provided. String text = item.getText(); if (text != null) { if (text.endsWith("\n")) { @@ -130,22 +138,34 @@ } configure.output(text); } + // Capture the value for the item property PropertySet.Property prop = script.getProperty(item.getPropName()); Value value = null; + Value defaultValue = prop.getDefaultValue(); do { - String info = prop.getType().describe(prop.getDefaultValue()); + String info = prop.getType().describe(defaultValue); String input = configure.input(prop.getDescription() + " " + info + ":"); if (input == null) { throw new ConfigureException("Unexpected EOF on input"); } value = prop.getType().fromInput(input); - if (value == null && input.length() == 0 && prop.hasDefaultValue()) { - configure.debug("Trying default"); - value = prop.getDefaultValue(); + if (value == null && input.length() == 0 && defaultValue != null) { + configure.debug("Using default"); + value = defaultValue; } + // Loop until we get a permissible value. } while (value == null); prop.setValue(value); configure.output(""); + if (item.getChanged() != null) { + // Display message if property value has changed. + String oldValue = (defaultValue == null) ? "" : defaultValue.getText(); + String newValue = value.getText(); + if (!oldValue.equals(newValue)) { + configure.output(item.getChanged()); + configure.output(""); + } + } } } } Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -63,6 +63,7 @@ public static final String DEFAULT_MARKER = "@"; public static final String VALIDATION_CLASS = "validationClass"; public static final String SCREEN = "screen"; + public static final String CHANGED = "changed"; public static final String NAME = "name"; public static final String PATTERN = "pattern"; public static final String ALT = "alt"; @@ -421,10 +422,11 @@ error("The '" + PROPERTY + "' attribute is required for an '" + ITEM + "' element", child); } + String changed = child.getAttribute(CHANGED, null); if (script.getProperty(propName) == null) { error("Use of undeclared property '" + propName + "'", child); } - screen.addItem(new Item(script, propName, unindent(child.getContent()))); + screen.addItem(new Item(script, propName, unindent(child.getContent()), changed)); } } Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -41,7 +41,6 @@ import org.jnode.configure.Configure; import org.jnode.configure.ConfigureException; import org.jnode.configure.PropertySet; -import org.jnode.configure.PropertyType; import org.jnode.configure.ScriptParser; import org.jnode.configure.PropertySet.Property; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -20,7 +20,6 @@ */ package org.jnode.configure.adapter; -import org.jnode.configure.ConfigureException; /** * Dummy property value encoder / decoder. Performs the identity transform. Modified: trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -20,7 +20,6 @@ */ package org.jnode.configure.adapter; -import org.jnode.configure.ConfigureException; /** * Encoder / decoder for properties embedded in Java code in literal strings or Modified: trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -3,7 +3,6 @@ */ package org.jnode.configure.adapter; -import org.jnode.configure.ConfigureException; /** * Encode / decode for property values in classic Java property files. (This Modified: trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java 2008-07-30 13:22:53 UTC (rev 4370) +++ trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java 2008-07-31 12:50:34 UTC (rev 4371) @@ -20,7 +20,6 @@ */ package org.jnode.configure.adapter; -import org.jnode.configure.ConfigureException; /** * Encode / decode for the context of text contents of an XML element. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-08-02 07:00:00
|
Revision: 4384 http://jnode.svn.sourceforge.net/jnode/?rev=4384&view=rev Author: crawley Date: 2008-08-02 06:59:57 +0000 (Sat, 02 Aug 2008) Log Message: ----------- Added --verbose and --help options. The command now renames existing output files to <file>.bak Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Configure.java trunk/builder/src/configure/org/jnode/configure/PropertySet.java trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java Modified: trunk/builder/src/configure/org/jnode/configure/Configure.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-08-02 04:36:03 UTC (rev 4383) +++ trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-08-02 06:59:57 UTC (rev 4384) @@ -47,6 +47,29 @@ private final PrintStream err; private String scriptFile; private boolean debug; + private boolean verbose; + private boolean help; + + private static String USAGE = + "configure.sh [--debug] [--verbose] [--help] [<script>]"; + private static String[] DESCRIPTION = new String[] { + "Capture configuration properties based on the supplied <script>.", + " If no arguments or options are provided, defaults are supplied", + " by the wrapper script. A copy of the previous state of each", + " <file> updated is saved in '<file>.bak.'", + "Options:", + " --verbose output more information to help the user understand", + " what is happening.", + " --help output command help then exit", + " --debug enable debug output" + }; + private static String[] UI_HELP = new String[] { + "The program will prompt you for values for a series of properties,", + "showing a list of legal values or a regex. If there is a default", + "value, it will be shown in square brackets. At the prompt, type", + "an acceptable value for the property followed by ENTER. If you just", + "type ENTER, the default value (if any) will be used for the property." + }; private Configure() { this.in = new BufferedReader(new InputStreamReader(System.in)); @@ -57,10 +80,15 @@ private void run(String[] args) { try { parseArguments(args); + if (help) { + printHelp(); + return; + } ConfigureScript script = new ScriptParser(this).loadScript(scriptFile); for (PropertySet propFile : script.getPropsFiles()) { propFile.load(this); } + printUIHelp(); script.execute(this); for (PropertySet propFile : script.getPropsFiles()) { saveProperties(propFile); @@ -75,6 +103,28 @@ } } + private void printUIHelp() { + if (verbose) { + print(UI_HELP, out); + } + } + + private void printHelp() { + print(USAGE, err); + print(DESCRIPTION, err); + print(UI_HELP, err); + } + + private void print(String line, PrintStream stream) { + format(stream, line, DISPLAY_NORMAL); + } + + private void print(String[] lines, PrintStream stream) { + for (String line: lines) { + format(stream, line, DISPLAY_NORMAL); + } + } + /** * Parse the command line. * @@ -89,6 +139,11 @@ } if (arg.equals("--debug")) { debug = true; + } else if (arg.equals("--help")) { + help = true; + return; + } else if (arg.equals("--verbose")) { + verbose = true; } else { throw new ConfigureException("Unrecognized option: " + args[i]); } @@ -116,7 +171,7 @@ } public void output(String message) { - format(err, message, DISPLAY_NORMAL); + format(out, message, DISPLAY_NORMAL); } public void error(String message) { @@ -125,10 +180,16 @@ public void debug(String message) { if (debug) { - format(err, message, DISPLAY_NORMAL); + format(err, "[DEBUG] " + message, DISPLAY_NORMAL); } } + public void verbose(String message) { + if (verbose) { + format(out, "[VERBOSE] " + message, DISPLAY_NORMAL); + } + } + private void format(PrintStream stream, String text, int displayAttributes) { switch (displayAttributes) { case DISPLAY_PROMPT: Modified: trunk/builder/src/configure/org/jnode/configure/PropertySet.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2008-08-02 04:36:03 UTC (rev 4383) +++ trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2008-08-02 06:59:57 UTC (rev 4384) @@ -35,7 +35,7 @@ * @author cr...@jn... */ public class PropertySet { - public static class Property { + public class Property { private final String name; private final PropertyType type; private final String description; @@ -98,6 +98,14 @@ public void setDefaultValue(Value defaultValue) { this.defaultValue = defaultValue; } + + public boolean isControlProperty() { + return getPropertySet().getFile() == null; + } + + public PropertySet getPropertySet() { + return PropertySet.this; + } } public static class Value { @@ -171,7 +179,23 @@ } public void save(Configure configure) throws ConfigureException { + if (file.exists()) { + File file = this.file.getAbsoluteFile(); + File backup = new File(file.getParentFile(), file.getName() + ".bak"); + if (backup.exists()) { + if (!backup.delete()) { + throw new ConfigureException( + "Cannot delete existing '" + backup + "'"); + } + } + if (!file.renameTo(backup)) { + throw new ConfigureException( + "Cannot rename existing '" + file + "' as '" + backup + "'"); + } + configure.verbose("Renamed existing '" + file + "' as '" + backup + "'"); + } adapter.save(this, configure); + configure.verbose("Saved properties to '" + file + "'"); } public File getFile() { Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-08-02 04:36:03 UTC (rev 4383) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-08-02 06:59:57 UTC (rev 4384) @@ -166,6 +166,11 @@ configure.output(""); } } + if (!prop.isControlProperty()) { + configure.verbose( + "Setting property " + prop.getName() + " to " + + "\"" + value.getText() + "\""); + } } } } Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-08-02 04:36:03 UTC (rev 4383) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-08-02 06:59:57 UTC (rev 4384) @@ -133,10 +133,12 @@ } public ConfigureScript loadScript(String fileName) throws ConfigureException { + configure.verbose("Loading configure script from " + fileName); final File file = new File(fileName); stack.add(new ParseContext(file)); try { final XMLElement root = loadXML(file); + configure.debug("Parsing script"); return parseScript(root, file); } finally { stack.removeLast(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-08-10 14:23:28
|
Revision: 4421 http://jnode.svn.sourceforge.net/jnode/?rev=4421&view=rev Author: crawley Date: 2008-08-10 14:23:26 +0000 (Sun, 10 Aug 2008) Log Message: ----------- More bug fixes for default property values ... Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-08-09 18:20:41 UTC (rev 4420) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2008-08-10 14:23:26 UTC (rev 4421) @@ -148,10 +148,13 @@ if (input == null) { throw new ConfigureException("Unexpected EOF on input"); } - value = prop.getType().fromInput(input); - if (value == null && input.length() == 0 && defaultValue != null) { - configure.debug("Using default"); - value = defaultValue; + if (input.length() == 0) { + if (defaultValue != null) { + configure.debug("Using default"); + value = defaultValue; + } + } else { + value = prop.getType().fromInput(input); } // Loop until we get a permissible value. } while (value == null); Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-08-09 18:20:41 UTC (rev 4420) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2008-08-10 14:23:26 UTC (rev 4421) @@ -354,12 +354,12 @@ error("A '" + PROPERTY + "' element requires a '" + DESCRIPTION + "' attribute", child); } - String defaultText = child.getAttribute(DEFAULT, null); + String defaultText = child.getAttribute(DEFAULT, ""); PropertyType type = script.getTypes().get(typeName); if (type == null) { error("Use of undeclared type '" + typeName + "'", child); } - Value defaultValue = (defaultText == null) ? null : type.fromValue(defaultText); + Value defaultValue = type.fromValue(defaultText); configure.debug("Default value for " + name + " is " + (defaultValue == null ? "null" : defaultValue.toString())); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2008-08-18 15:23:28
|
Revision: 4462 http://jnode.svn.sourceforge.net/jnode/?rev=4462&view=rev Author: crawley Date: 2008-08-18 15:23:22 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Added some code to preserve copies of any original (non-generated) property files the first time that the tool is run. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/PropertySet.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java Modified: trunk/builder/src/configure/org/jnode/configure/PropertySet.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2008-08-18 15:19:23 UTC (rev 4461) +++ trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2008-08-18 15:23:22 UTC (rev 4462) @@ -178,15 +178,33 @@ adapter.load(this, configure); } + /** + * Save the properties in this property set to the property file. This + * method takes care of creating a backup file + * + * @param configure + * @throws ConfigureException + */ public void save(Configure configure) throws ConfigureException { if (file.exists()) { File file = this.file.getAbsoluteFile(); - File backup = new File(file.getParentFile(), file.getName() + ".bak"); - if (backup.exists()) { - if (!backup.delete()) { - throw new ConfigureException( - "Cannot delete existing '" + backup + "'"); + File backup; + if (adapter.wasSourceGenerated(this)) { + backup = new File(file.getParentFile(), file.getName() + ".bak"); + if (backup.exists()) { + if (!backup.delete()) { + throw new ConfigureException( + "Cannot delete existing '" + backup + "'"); + } } + } else { + backup = new File(file.getParentFile(), file.getName() + ".orig"); + int no = 1; + while (backup.exists()) { + backup = new File(file.getParentFile(), file.getName() + ".orig" + ++no); + } + configure.output("Saving the current (non-generated!) " + file.getName() + " file"); + configure.output("as " + backup); } if (!file.renameTo(backup)) { throw new ConfigureException( @@ -247,4 +265,5 @@ public Property getProperty(String name) { return properties.get(name); } + } Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-08-18 15:19:23 UTC (rev 4461) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2008-08-18 15:23:22 UTC (rev 4462) @@ -28,6 +28,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -93,6 +94,66 @@ public boolean isSaveSupported() { return saveSupported; } + + public final boolean wasSourceGenerated(PropertySet propSet) throws ConfigureException { + File propFile = propSet.getFile(); + if (!propFile.exists()) { + return false; + } + String expectedFirstLine; + File templateFile = propSet.getTemplateFile(); + if (templateFile != null && templateFile.exists()) { + expectedFirstLine = readFirstLine(templateFile); + } else { + expectedFirstLine = getSignatureLine(); + } + String firstLine = readFirstLine(propFile); + return (firstLine == null || expectedFirstLine == null || + firstLine.equals(expectedFirstLine.trim())); + } + + /** + * Return the first non-trivial line in the file; i.e. the first line of the + * file whose length is > 3 after trimming. (A trimmed line with 1 to 3 + * characters is most likely to be some kind of comment marker.) + * + * @param file the file to be read. + * @return the line or <code>null</code>. + */ + private String readFirstLine(File file) { + BufferedReader br = null; + try { + br = new BufferedReader(new FileReader(file)); + String line; + while ((line = br.readLine()) != null) { + line = line.trim(); + if (line.length() > 3) { + return line; + } + } + return null; + } catch (IOException ex) { + return null; + } finally { + if (br != null) { + try { + br.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + + /** + * Override this method to return a fixed 'signature' line that a generated + * file will started. + * + * @return the signature line or <code>null</code>. + */ + protected String getSignatureLine() { + return null; + } public void load(PropertySet propSet, Configure configure) throws ConfigureException { File file = propSet.getFile(); Modified: trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java 2008-08-18 15:19:23 UTC (rev 4461) +++ trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java 2008-08-18 15:23:22 UTC (rev 4462) @@ -63,11 +63,40 @@ */ public static final String TEXT_FORMAT = "text"; + /** + * Test if this adapter supported loading of property values. + * @return <code>true</code> if loading is supported. + */ public boolean isLoadSupported(); + /** + * Test if this adapter supported loading of property values without a template + * @return <code>true</code> if saving is supported. + */ public boolean isSaveSupported(); + /** + * Load the properties for a property set. + * @param propSet the property set to be loaded + * @param configure provides diagnostic methods + * @throws ConfigureException + */ public void load(PropertySet propSet, Configure configure) throws ConfigureException; + /** + * Save the properties for a property set. + * @param propSet the property set to be saved + * @param configure provides diagnostic methods + * @throws ConfigureException + */ public void save(PropertySet propSet, Configure configure) throws ConfigureException; + + /** + * Test if the property set's source file was, or could have been generated by this + * program. + * @param propSet tells us about the source file + * @return <code>true</code> if the file couols have been generated; <code>false</code> otherwise. + * @throws ConfigureException + */ + public boolean wasSourceGenerated(PropertySet propSet) throws ConfigureException; } Modified: trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java 2008-08-18 15:19:23 UTC (rev 4461) +++ trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java 2008-08-18 15:23:22 UTC (rev 4462) @@ -32,6 +32,8 @@ * @author cr...@jn... */ public class PropertyFileAdapter extends BasePropertyFileAdapter { + + private static final String SIGNATURE = "# Generated by the JNode configure utility"; private static BasePropertyFileAdapter.ValueCodec PROPERTY_VALUE_CODEC = new PropertyValueCodec(); @@ -48,7 +50,13 @@ @Override protected void saveToFile(Properties props, OutputStream output, String comment) throws IOException { + output.write(SIGNATURE.getBytes()); + output.write(System.getProperty("line.separator").getBytes()); props.store(output, comment); } + @Override + protected String getSignatureLine() { + return SIGNATURE; + } } Modified: trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java 2008-08-18 15:19:23 UTC (rev 4461) +++ trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java 2008-08-18 15:23:22 UTC (rev 4462) @@ -31,6 +31,8 @@ * @author cr...@jn... */ public class XMLPropertyFileAdapter extends BasePropertyFileAdapter { + private static final String SIGNATURE = "<!-- Generated by the JNode configure utility -->"; + private static BasePropertyFileAdapter.ValueCodec XML_VALUE_CODEC = new XMLValueCodec(); public XMLPropertyFileAdapter() { @@ -45,6 +47,13 @@ @Override protected void saveToFile(Properties props, OutputStream output, String comment) throws IOException { + output.write(SIGNATURE.getBytes()); + output.write(System.getProperty("line.separator").getBytes()); props.storeToXML(output, comment); } + + @Override + protected String getSignatureLine() { + return SIGNATURE; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2013-02-17 17:39:28
|
Revision: 5953 http://jnode.svn.sourceforge.net/jnode/?rev=5953&view=rev Author: lsantha Date: 2013-02-17 17:39:21 +0000 (Sun, 17 Feb 2013) Log Message: ----------- Updated headers. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Configure.java trunk/builder/src/configure/org/jnode/configure/ConfigureException.java trunk/builder/src/configure/org/jnode/configure/ConfigureScript.java trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java trunk/builder/src/configure/org/jnode/configure/PatternType.java trunk/builder/src/configure/org/jnode/configure/PropertySet.java trunk/builder/src/configure/org/jnode/configure/PropertyType.java trunk/builder/src/configure/org/jnode/configure/Screen.java trunk/builder/src/configure/org/jnode/configure/ScriptParser.java trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapterFactory.java trunk/builder/src/configure/org/jnode/configure/adapter/JavaSourceFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java trunk/builder/src/configure/org/jnode/configure/adapter/TextFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/XMLFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java Modified: trunk/builder/src/configure/org/jnode/configure/Configure.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Configure.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/Configure.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.io.BufferedReader; Modified: trunk/builder/src/configure/org/jnode/configure/ConfigureException.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ConfigureException.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/ConfigureException.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; /** Modified: trunk/builder/src/configure/org/jnode/configure/ConfigureScript.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ConfigureScript.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/ConfigureScript.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.io.File; Modified: trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/EnumeratedType.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.util.List; Modified: trunk/builder/src/configure/org/jnode/configure/PatternType.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PatternType.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/PatternType.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.util.regex.Matcher; Modified: trunk/builder/src/configure/org/jnode/configure/PropertySet.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/PropertySet.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.io.File; Modified: trunk/builder/src/configure/org/jnode/configure/PropertyType.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PropertyType.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/PropertyType.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import org.jnode.configure.PropertySet.Value; Modified: trunk/builder/src/configure/org/jnode/configure/Screen.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Screen.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/Screen.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.util.ArrayList; Modified: trunk/builder/src/configure/org/jnode/configure/ScriptParser.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/ScriptParser.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure; import java.io.File; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/BasePropertyFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.BufferedInputStream; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/DummyValueCodec.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import org.jnode.configure.Configure; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapterFactory.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapterFactory.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/FileAdapterFactory.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import org.jnode.configure.ConfigureException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/JavaSourceFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/JavaSourceFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/JavaSourceFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.IOException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/JavaStringLiteralCodec.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/PropertyFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.IOException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/PropertyValueCodec.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,6 +1,23 @@ -/** - * +/* + * $Id$ + * + * Copyright (C) 2003-2013 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/TextFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/TextFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/TextFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.IOException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/XMLFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/XMLFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/XMLFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.IOException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/XMLPropertyFileAdapter.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; import java.io.IOException; Modified: trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java 2013-02-17 15:47:51 UTC (rev 5952) +++ trunk/builder/src/configure/org/jnode/configure/adapter/XMLValueCodec.java 2013-02-17 17:39:21 UTC (rev 5953) @@ -1,8 +1,7 @@ /* - * $Id $ + * $Id$ * - * JNode.org - * Copyright (C) 2003-2006 JNode.org + * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -18,6 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + package org.jnode.configure.adapter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |