public class GUICommandFactoryImpl extends java.lang.Object implements GUICommandFactory
GUICommand
instances from string
representation.Modifier and Type | Field and Description |
---|---|
private CommandCallback |
commandCallback
The
CommandCallback to use. |
private CommandExecutor |
commandExecutor
The
CommandExecutor instance to use. |
private Macros |
macros
The
Macros instance to use. |
private static java.util.regex.Pattern |
PATTERN_ENCODE
Pattern matching lines that need a
TRAILING_ESCAPE appended. |
private static java.lang.String |
TRAILING_ESCAPE
Character appended to lines ending with whitespace.
|
Constructor and Description |
---|
GUICommandFactoryImpl(CommandCallback commandCallback,
CommandExecutor commandExecutor,
Macros macros)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
GUICommand |
createCommand(java.lang.String commandString)
Creates a new
GUICommand instance from string representation. |
GUICommand |
createCommandDecode(java.lang.String encodedCommandString)
Creates a new
GUICommand instance from string representation. |
java.lang.String |
decode(java.lang.String command)
Decodes a key binding if necessary.
|
java.lang.String |
encode(java.lang.String command)
Encodes a key binding if necessary.
|
@NotNull private final CommandCallback commandCallback
CommandCallback
to use.@NotNull private final CommandExecutor commandExecutor
CommandExecutor
instance to use.@NotNull private static final java.util.regex.Pattern PATTERN_ENCODE
TRAILING_ESCAPE
appended.@NotNull private static final java.lang.String TRAILING_ESCAPE
public GUICommandFactoryImpl(@NotNull CommandCallback commandCallback, @NotNull CommandExecutor commandExecutor, @NotNull Macros macros)
commandCallback
- the command callback to usecommandExecutor
- the command executor instance to usemacros
- the macros instance to use@NotNull public GUICommand createCommand(@NotNull java.lang.String commandString)
GUICommand
instance from string representation.createCommand
in interface GUICommandFactory
commandString
- the command string representationpublic GUICommand createCommandDecode(@NotNull java.lang.String encodedCommandString)
GUICommand
instance from string representation.createCommandDecode
in interface GUICommandFactory
encodedCommandString
- the command string representation@NotNull public java.lang.String decode(@NotNull java.lang.String command)
decode
in interface GUICommandFactory
command
- the key binding@NotNull public java.lang.String encode(@NotNull java.lang.String command)
encode
in interface GUICommandFactory
command
- the key binding