|
From: <cr...@us...> - 2009-05-31 02:13:58
|
Revision: 5531
http://jnode.svn.sourceforge.net/jnode/?rev=5531&view=rev
Author: crawley
Date: 2009-05-31 02:13:50 +0000 (Sun, 31 May 2009)
Log Message:
-----------
javadoc and checkstyle fixes
Modified Paths:
--------------
trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java
trunk/shell/src/shell/org/jnode/shell/CommandInfo.java
trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/Shell.java
trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java
trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java
trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java
Modified: trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -22,7 +22,6 @@
import org.apache.log4j.Logger;
import org.jnode.driver.console.CompletionInfo;
-import org.jnode.shell.bjorne.BjorneCompleter;
import org.jnode.shell.syntax.Argument;
import org.jnode.shell.syntax.ArgumentBundle;
Modified: trunk/shell/src/shell/org/jnode/shell/CommandInfo.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/CommandInfo.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/CommandInfo.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -55,7 +55,6 @@
* @param clazz the designated {@code Class} for executing the command
* @param commandName the name, or alias, for the command
* @param syntaxBundle the syntax definition to parse the command line against
- * @param argBundle the optional {@code ArgumentBundle} to parse the command line against
*/
public CommandInfo(Class<?> clazz, String commandName, SyntaxBundle syntaxBundle, boolean internal) {
this.clazz = clazz;
@@ -94,7 +93,7 @@
}
/**
- * Checks wether this command is considered internal or not.
+ * Checks whether this command is considered internal or not.
*
* @return true if this is an internal command
* @see org.jnode.shell.alias.AliasManager#isInternal
Modified: trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -43,7 +43,7 @@
/**
* This CommandInvoker runs a command in the current thread, using the command
* classes <code>public static void main(String[] args)</code> entry point.
- * The {@link #invokeAsynchronous(CommandLine, CommandInfo)} method is not
+ * The {@link #invokeAsynchronous(CommandLine)} method is not
* supported for this implementation of the CommandInvoker API.
*
* @author Sam Reid
@@ -76,7 +76,10 @@
}
/**
- * Invoke the command.
+ * Invoke the command, running is by calling the entry point method from the
+ * current thread. No redirection is allowed.
+ *
+ * @param cmdLine the command line.
*/
public int invoke(CommandLine cmdLine) throws ShellException {
CommandInfo cmdInfo = cmdLine.parseCommandLine(shell);
Modified: trunk/shell/src/shell/org/jnode/shell/Shell.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/Shell.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/Shell.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -105,25 +105,25 @@
* Set a shell property. Some properties have special meaning to a Shell
* and may cause its behavior to change.
*
- * @param propName the name of the property
+ * @param key the name of the property
* @param value the property value
* @throws ShellException This may be thrown if the name / value pair is
* not acceptable.
*/
- public void setProperty(String propName, String value) throws ShellException;
+ public void setProperty(String key, String value) throws ShellException;
/**
* Get the current value of a shell property.
*
- * @param propName the property name.
+ * @param key the property name.
* @return the property value or {@code null}
*/
- public String getProperty(String propName);
+ public String getProperty(String key);
/**
* Remove a shell property. Special properties typically may not be removed,
*
- * @param propName the name of the property
+ * @param key the name of the property
* @throws ShellException This may be thrown if the property cannot be removed.
*/
public void removeProperty(String key) throws ShellException;
Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -612,7 +612,8 @@
CommandNode cond = parseCompoundList(TOK_THEN_BIT);
allowLineBreaks();
expectNext(TOK_THEN_BIT, RULE_1_CONTEXT);
- return new IfCommandNode(CMD_ELIF, cond, parseCompoundList(TOK_ELIF_BIT | TOK_ELSE_BIT | TOK_FI_BIT), parseOptElsePart());
+ return new IfCommandNode(CMD_ELIF, cond,
+ parseCompoundList(TOK_ELIF_BIT | TOK_ELSE_BIT | TOK_FI_BIT), parseOptElsePart());
} else {
return parseCompoundList(TOK_FI_BIT);
}
Modified: trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -25,7 +25,8 @@
/**
* A SyntaxManager manages the association between a command "alias" and
- * the Syntax that specifies its argument syntax.
+ * the Syntax that specifies its argument syntax. The manager can also
+ * record a set of argument specs for non-native commands.
*
* @author cr...@jn...
*/
@@ -39,14 +40,23 @@
public static final String SYNTAXES_EP_NAME = "org.jnode.shell.syntaxes";
/**
- * Add a syntax bundle
+ * Add a syntax bundle, using the alias name embedded in the bundle.
*
* @param bundle The syntax to be added
*/
public abstract void add(SyntaxBundle bundle);
/**
- * Remove the syntaxBundle and argumentBundle(if one exists) for an alias
+ * Add the argument specs for a non-native command; i.e. one which does
+ * not define and register its own arguments.
+ *
+ * @param argSpecs the specs for the arguments
+ * @param alias the alias
+ */
+ public abstract void add(String alias, ArgumentSpec<?>[] argSpecs);
+
+ /**
+ * Remove the syntaxBundle and argumentBundle (if one exists) for an alias
*
* @param alias The alias
*/
@@ -55,20 +65,12 @@
/**
* Gets the syntax bundle for a given alias
*
- * @param alias The alias
+ * @param alias the alias
* @return The syntax for the given alias, or <code>null</code>
*/
public abstract SyntaxBundle getSyntaxBundle(String alias);
/**
- * Add an argument bundle for a bare command.
- *
- * @param bundle an argument bundle holding the arguments of a bare command
- * @param alias the alias to bind the arguments to
- */
- public abstract void add(String alias, ArgumentSpec<?>[] args);
-
- /**
* Gets the argument bundle for a given alias if one exists.
*
* @param alias an alias that corresponds to a particular bundle
Modified: trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java
===================================================================
--- trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java 2009-05-31 01:45:21 UTC (rev 5530)
+++ trunk/shell/src/test/org/jnode/test/shell/bjorne/BjorneCompletionTests.java 2009-05-31 02:13:50 UTC (rev 5531)
@@ -259,25 +259,30 @@
switch (flags.charAt(inWord)) {
case 'T':
// Expect completions
- assertTrue("got no completions: " + diag(partial, completions), completionWords.size() > 0);
+ assertTrue("got no completions: " + diag(partial, completions),
+ completionWords.size() > 0);
break;
case 'F':
// Expect no completions
- assertTrue("got unexpected completions: " + diag(partial, completions), completionWords.size() == 0);
+ assertTrue("got unexpected completions: " + diag(partial, completions),
+ completionWords.size() == 0);
break;
case 'E':
// Expect completions if the last char is ' ', otherwise not
if (wordStart >= partial.length()) {
- assertTrue("got no completions: " + diag(partial, completions), completionWords.size() > 0);
+ assertTrue("got no completions: " + diag(partial, completions),
+ completionWords.size() > 0);
} else {
- assertTrue("got unexpected completions: " + diag(partial, completions), completionWords.size() == 0);
+ assertTrue("got unexpected completions: " + diag(partial, completions),
+ completionWords.size() == 0);
}
break;
case 'Z':
// Expect completions if the last char is NOT ' '
if (wordStart >= partial.length()) {
} else {
- assertTrue("got no completions: " + diag(partial, completions), completionWords.size() > 0);
+ assertTrue("got no completions: " + diag(partial, completions),
+ completionWords.size() > 0);
}
break;
case '?':
@@ -285,7 +290,8 @@
}
for (String completionWord : completionWords) {
if (!completionWord.startsWith(lastWord)) {
- fail("completion(s) don't start with '" + lastWord + "': " + diag(partial, completions));
+ fail("completion(s) don't start with '" + lastWord + "': " +
+ diag(partial, completions));
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|