Class CommandParser


  • public class CommandParser
    extends java.lang.Object
    Parser for creating GUICommand instances from string representations.
    • Constructor Detail

      • CommandParser

        public CommandParser​(@NotNull
                             @NotNull Dialogs dialogs,
                             @NotNull
                             @NotNull FloorView floorView,
                             @NotNull
                             @NotNull InventoryView inventoryView,
                             @NotNull
                             @NotNull QuestsView questsView,
                             @NotNull
                             @NotNull JXCSkinCache<AbstractGUIElement> definedGUIElements,
                             @NotNull
                             @NotNull GuiFactory guiFactory,
                             @NotNull
                             @NotNull NewCharModel newCharModel)
        Creates a new instance.
        Parameters:
        dialogs - the dialogs instance to use
        floorView - the floor view to use
        inventoryView - the inventory view to use
        definedGUIElements - the defined GUI elements
        guiFactory - the global GUI factory instance
        newCharModel - the global new char model instance
    • Method Detail

      • parseCommandArgs

        @NotNull
        public @NotNull GUICommand parseCommandArgs​(@NotNull
                                                    @NotNull Args args,
                                                    @Nullable
                                                    @Nullable AbstractGUIElement element,
                                                    @NotNull
                                                    @NotNull java.lang.String command,
                                                    @NotNull
                                                    @NotNull GuiStateManager guiStateManager,
                                                    @NotNull
                                                    @NotNull CommandExecutor commandExecutor,
                                                    @NotNull
                                                    @NotNull java.io.LineNumberReader lnr,
                                                    @NotNull
                                                    @NotNull CommandQueue commandQueue,
                                                    @NotNull
                                                    @NotNull CrossfireServerConnection crossfireServerConnection,
                                                    @NotNull
                                                    @NotNull CommandCallback commandCallback,
                                                    @NotNull
                                                    @NotNull Macros macros)
                                             throws java.io.IOException,
                                                    JXCSkinException
        Parses and builds command arguments.
        Parameters:
        args - the list of arguments
        element - the target element
        command - the command to parse the arguments of
        guiStateManager - the gui state manager instance
        commandExecutor - the command executor for executing commands
        lnr - the source to read more parameters from
        commandQueue - the command queue for executing commands
        crossfireServerConnection - the server connection to use
        commandCallback - the command callback to use
        macros - the macros instance to use
        Returns:
        the command arguments
        Throws:
        java.io.IOException - if a syntax error occurs
        JXCSkinException - if an element cannot be found