public final class MacroUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
argsArrayToMap(java.lang.String[] argsArray)
Converts an array containing parameter-value-pairs to a map.
|
static java.lang.String[] |
argsMapToArray(java.util.Map<java.lang.String,java.lang.String> argsMap)
Converts a map containing key-value pairs of command line input to an string array.
|
static void |
checkForForbiddenKeys(java.util.Map<java.lang.String,java.lang.String> argumentMap)
Checks weather a given map containt forbidden keys found in 'ARG.MACRO_FORBIDDEN_KEYS'.
|
static java.util.Properties |
getMacroFileProperties(java.lang.String macroName)
Read the macro propertie file and retrieves all command line arguments and parameters as a Propertie-object.
|
static java.io.File[] |
getMacros()
Returns all macro files in this applications directory.
|
static void |
saveMacroProperties(java.util.Properties newMacro,
java.lang.String macroName)
Save a new macro represented by a Propertie-object to the macro propertie file.
|
static java.lang.String[] |
stringToArrayMap(java.lang.String argsString)
Does the same as calling .split(" ") on a String variable.
|
public static void checkForForbiddenKeys(java.util.Map<java.lang.String,java.lang.String> argumentMap) throws MacroException
argumentMap
- (MapMacroException
- Thrown when an illegal key is found in the map.public static java.lang.String[] stringToArrayMap(java.lang.String argsString)
argsString
- (String) Input string.public static java.util.Properties getMacroFileProperties(java.lang.String macroName) throws java.io.IOException
macroName
- Add.java.io.IOException
- The macro properties file was not found or could not be read.public static void saveMacroProperties(java.util.Properties newMacro, java.lang.String macroName) throws java.io.IOException
newMacro
- (Properties) The new macro.macroName
- (String) Name of the new macro.java.io.IOException
- The macro properties file was not found or could not be written to.public static java.util.Map<java.lang.String,java.lang.String> argsArrayToMap(java.lang.String[] argsArray)
argsArray
- (String[]) Array containing command line parameters and values.public static java.lang.String[] argsMapToArray(java.util.Map<java.lang.String,java.lang.String> argsMap)
argsMap
- (Mappublic static java.io.File[] getMacros()