diff --git a/client/.settings/org.eclipse.jdt.ui.prefs b/client/.settings/org.eclipse.jdt.ui.prefs
index 1d718a1..359aaeb 100644
--- a/client/.settings/org.eclipse.jdt.ui.prefs
+++ b/client/.settings/org.eclipse.jdt.ui.prefs
@@ -6,4 +6,4 @@ org.eclipse.jdt.ui.importorder=java;javax;javafx;org;com;envoy;
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.ondemandthreshold=4
org.eclipse.jdt.ui.staticondemandthreshold=2
-org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * @return the ${bare_field_name}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * @param ${param} the ${bare_field_name} to set\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * Project\: <strong>${project_name}</strong><br>\r\n * File\: <strong>${file_name}</strong><br>\r\n * Created\: <strong>${date}</strong><br>\r\n *\r\n * @author ${user}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * {@inheritDoc}\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n * @since Envoy Client v0.1-beta\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n${exception_var}.printStackTrace();${body_statement}${body_statement}return ${field};${field} \= ${param};
+org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * @return the ${bare_field_name}\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * @param ${param} the ${bare_field_name} to set\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * Project\: <strong>${project_name}</strong><br>\r\n * File\: <strong>${file_name}</strong><br>\r\n * Created\: <strong>${date}</strong><br>\r\n *\r\n * @author ${user}\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n * @since Envoy Client v0.2-beta\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n * @since Envoy Client v0.2-beta\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n${exception_var}.printStackTrace();${body_statement}${body_statement}return ${field};${field} \= ${param};
diff --git a/client/src/main/java/envoy/client/data/commands/SystemCommand.java b/client/src/main/java/envoy/client/data/commands/SystemCommand.java
index 17b3db0..9a3eecd 100644
--- a/client/src/main/java/envoy/client/data/commands/SystemCommand.java
+++ b/client/src/main/java/envoy/client/data/commands/SystemCommand.java
@@ -18,7 +18,7 @@ import java.util.function.Function;
* Created: 16.07.2020
*
* @author Leon Hofmeister
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public final class SystemCommand {
@@ -46,7 +46,7 @@ public final class SystemCommand {
* @param numberOfArguments the amount of arguments that need to be parsed for
* the underlying function
* @param description the description of this {@code SystemCommand}
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public SystemCommand(Function action, int numberOfArguments, String description) {
this.numberOfArguments = numberOfArguments;
@@ -56,20 +56,20 @@ public final class SystemCommand {
/**
* @return the action that should be performed
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public Function getAction() { return action; }
/**
* @return the amount of arguments that need to be parsed for
* the underlying function
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public int getNumberOfArguments() { return numberOfArguments; }
/**
* @return the description
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public String getDescription() { return description; }
}
diff --git a/client/src/main/java/envoy/client/data/commands/SystemCommandsMap.java b/client/src/main/java/envoy/client/data/commands/SystemCommandsMap.java
index 9e0cc82..5dedfd3 100644
--- a/client/src/main/java/envoy/client/data/commands/SystemCommandsMap.java
+++ b/client/src/main/java/envoy/client/data/commands/SystemCommandsMap.java
@@ -3,6 +3,7 @@ package envoy.client.data.commands;
import java.util.*;
import java.util.function.Function;
import java.util.logging.Level;
+import java.util.logging.Logger;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -16,9 +17,7 @@ import envoy.util.EnvoyLog;
* Created: 17.07.2020
*
* @author Leon Hofmeister
- * @since Envoy Client v0.1-beta
- * @apiNote Please refrain from using the "/"-char in keys of this map.
- * Unexpected behavior will occur.
+ * @since Envoy Client v0.2-beta
*/
public class SystemCommandsMap {
@@ -26,6 +25,8 @@ public class SystemCommandsMap {
private final Pattern commandBounds = Pattern.compile("^[a-zA-Z0-9_:!\\(\\)\\?\\.\\,\\;\\-]+$");
+ private static final Logger logger = EnvoyLog.getLogger(SystemCommandsMap.class);
+
private boolean commandExecuted = false;
/**
@@ -38,7 +39,7 @@ public class SystemCommandsMap {
* @param numberOfArguments the amount of arguments that need to be parsed for
* the underlying function
* @see SystemCommandsMap#isValidKey(String)
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void addCommand(String command, Function action, int numberOfArguments) {
if (isValidKey(command)) systemCommands.put(command, new SystemCommand(action, numberOfArguments, ""));
@@ -56,7 +57,7 @@ public class SystemCommandsMap {
* the underlying function
* @param description the description of this {@link SystemCommand}
* @see SystemCommandsMap#isValidKey(String)
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void addCommand(String command, Function action, int numberOfArguments, String description) {
if (isValidKey(command)) systemCommands.put(command, new SystemCommand(action, numberOfArguments, description));
@@ -70,7 +71,7 @@ public class SystemCommandsMap {
* @param action the action that should be performed. To see why this Function
* takes a {@code String[]}, see {@link SystemCommand}
* @see SystemCommandsMap#isValidKey(String)
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void addNoArgCommand(String command, Function action) { addCommand(command, action, 0); }
@@ -86,7 +87,7 @@ public class SystemCommandsMap {
* {@link SystemCommand}
* @param description the description of this {@link SystemCommand}
* @see SystemCommandsMap#isValidKey(String)
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void addNoArgCommand(String command, Function action, String description) { addCommand(command, action, 0); }
@@ -105,7 +106,7 @@ public class SystemCommandsMap {
* @param numberOfArguments the amount of arguments that need to be parsed for
* the underlying function
* @see SystemCommandsMap#isValidKey(String)
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void add(String command, Function action, int numberOfArguments) { addCommand(command, action, numberOfArguments); }
@@ -121,7 +122,7 @@ public class SystemCommandsMap {
*
* @param command the key to examine
* @return whether this key can be used in the map
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public final boolean isValidKey(String command) {
final boolean valid = commandBounds.matcher(command).matches();
@@ -150,7 +151,7 @@ public class SystemCommandsMap {
*
* @param input the input string given by the user, excluding the "/"
* @return the wrapped system command, if present
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public Optional checkPresent(String input) {
final var firstWord = input.substring(0, input.indexOf(" "));
@@ -165,7 +166,7 @@ public class SystemCommandsMap {
* continued.
*
* @param raw the raw input string
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void checkForCommands(String raw) { checkForCommands(raw, 0); }
@@ -179,7 +180,7 @@ public class SystemCommandsMap {
*
* @param raw the raw input string
* @param fromIndex the index to start checking on
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void checkForCommands(String raw, int fromIndex) {
// The minimum length of a command is "/" + a letter, hence raw.length()-2 is
@@ -215,7 +216,7 @@ public class SystemCommandsMap {
* result: {@code button.getText()=="xyz"}
*
* @param input the input string given by the user, excluding the "/"
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void executeIfPresent(String input) {
checkPresent(input).ifPresent(systemCommand -> {
@@ -231,7 +232,7 @@ public class SystemCommandsMap {
systemCommand.getAction().apply(arguments);
commandExecuted = true;
} catch (final Exception e) {
- EnvoyLog.getLogger(SystemCommandsMap.class).log(Level.WARNING, "The system command " +
+ logger.log(Level.WARNING, "The system command " +
// detected command
input.substring(0, input.indexOf(" ")) + " threw an exception: ", e);
}
@@ -248,7 +249,7 @@ public class SystemCommandsMap {
* @param input the input
* @param action the action that should be taken for the recommendations, if any
* are present
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public void requestRecommendations(String input, Function, Void> action) { requestRecommendations(input, 0, action); }
@@ -263,7 +264,7 @@ public class SystemCommandsMap {
* @param fromIndex the index to start checking on
* @param action the action that should be taken for the recommendations, if
* any are present
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
private void requestRecommendations(String input, int fromIndex, Function, Void> action) {
final var partialCommand = input.substring(fromIndex + (input.charAt(fromIndex) == '/' ? 1 : 0), input.indexOf(" "));
@@ -281,6 +282,7 @@ public class SystemCommandsMap {
*
* @param partialCommand the partially entered command
* @return a set of all commands that match this input
+ * @since Envoy Client v0.2-beta
*/
private Set recommendCommands(String partialCommand) {
// current implementation only looks if input is contained within a command,
@@ -290,7 +292,7 @@ public class SystemCommandsMap {
/**
* @return all {@link SystemCommand}s used with the underlying command as key
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
public HashMap getSystemCommands() { return systemCommands; }
}
diff --git a/client/src/main/java/envoy/client/data/commands/package-info.java b/client/src/main/java/envoy/client/data/commands/package-info.java
index e123e81..b3f2b4f 100644
--- a/client/src/main/java/envoy/client/data/commands/package-info.java
+++ b/client/src/main/java/envoy/client/data/commands/package-info.java
@@ -7,6 +7,6 @@
* Created: 16.07.2020
*
* @author Leon Hofmeister
- * @since Envoy Client v0.1-beta
+ * @since Envoy Client v0.2-beta
*/
package envoy.client.data.commands;
diff --git a/common/.settings/org.eclipse.jdt.ui.prefs b/common/.settings/org.eclipse.jdt.ui.prefs
index 1d718a1..3110cf7 100644
--- a/common/.settings/org.eclipse.jdt.ui.prefs
+++ b/common/.settings/org.eclipse.jdt.ui.prefs
@@ -6,4 +6,4 @@ org.eclipse.jdt.ui.importorder=java;javax;javafx;org;com;envoy;
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.ondemandthreshold=4
org.eclipse.jdt.ui.staticondemandthreshold=2
-org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * @return the ${bare_field_name}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * @param ${param} the ${bare_field_name} to set\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * Project\: <strong>${project_name}</strong><br>\r\n * File\: <strong>${file_name}</strong><br>\r\n * Created\: <strong>${date}</strong><br>\r\n *\r\n * @author ${user}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n * @since Envoy Client v0.1-beta\r\n *//**\r\n * {@inheritDoc}\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n * @since Envoy Client v0.1-beta\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n${exception_var}.printStackTrace();${body_statement}${body_statement}return ${field};${field} \= ${param};
+org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * @return the ${bare_field_name}\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * @param ${param} the ${bare_field_name} to set\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * Project\: <strong>${project_name}</strong><br>\r\n * File\: <strong>${file_name}</strong><br>\r\n * Created\: <strong>${date}</strong><br>\r\n *\r\n * @author ${user}\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n * @since Envoy Common v0.2-beta\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n * @since Envoy Common v0.2-beta\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n${exception_var}.printStackTrace();${body_statement}${body_statement}return ${field};${field} \= ${param};
diff --git a/server/.settings/org.eclipse.jdt.ui.prefs b/server/.settings/org.eclipse.jdt.ui.prefs
index cb37178..d951389 100755
--- a/server/.settings/org.eclipse.jdt.ui.prefs
+++ b/server/.settings/org.eclipse.jdt.ui.prefs
@@ -2,4 +2,4 @@ eclipse.preferences.version=1
formatter_profile=_KSKE
formatter_settings_version=18
org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.text.custom_code_templates=/**\n * @return the ${bare_field_name}\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * @param ${param} the ${bare_field_name} to set\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * Creates an instance of @link{${enclosing_type}}.\n *\n * ${tags}\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * Project\: <strong>${project_name}</strong><br>\n * File\: <strong>${file_name}</strong><br>\n * Created\: <strong>${date}</strong><br>\n * \n * @author ${user}\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * ${tags}\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * @author ${user}\n *\n * ${tags}\n * @since Envoy Server Standalone v0.1-beta\n *//**\n * {@inheritDoc}\n *//**\n * ${tags}\n * ${see_to_target}\n * @since Envoy Server Standalone v0.1-beta\n */${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}\n\n\n\n${exception_var}.printStackTrace();${body_statement}\n${body_statement}\nreturn ${field};${field} \= ${param};
+org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * @return the ${bare_field_name}\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * @param ${param} the ${bare_field_name} to set\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * Creates an instance of @link{${enclosing_type}}.\r\n *\r\n * ${tags}\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * Project\: <strong>${project_name}</strong><br>\r\n * File\: <strong>${file_name}</strong><br>\r\n * Created\: <strong>${date}</strong><br>\r\n * \r\n * @author ${user}\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * ${tags}\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n * @since Envoy Server v0.2-beta\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n * @since Envoy Server v0.2-beta\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n${exception_var}.printStackTrace();${body_statement}\r\n${body_statement}\r\nreturn ${field};${field} \= ${param};