Class StdCommandHandler
java.lang.Object
pro.gravit.utils.command.CommandHandler
pro.gravit.utils.command.StdCommandHandler
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class CommandHandler
CommandHandler.Category, CommandHandler.CommandWalkModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields inherited from class CommandHandler
baseCategory, categoriesModifier and TypeFieldDescriptionprotected final CommandCategoryprotected final List<CommandHandler.Category> -
Constructor Summary
ConstructorsModifierConstructorDescriptionStdCommandHandler(boolean readCommands) StdCommandHandler(BufferedReader reader) StdCommandHandler(InputStream stream) protectedStdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, boolean readCommands) protectedStdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, BufferedReader reader) protectedStdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, InputStream stream) -
Method Summary
Modifier and TypeMethodDescriptionvoidbell()If supported, sends a bell signal to the consolevoidclear()Cleans the consoleofHandler(CommandHandler commandHandler, boolean readCommands) ofHandler(CommandHandler commandHandler, BufferedReader reader) ofHandler(CommandHandler commandHandler, InputStream stream) readLine()Reads a line from the consoleMethods inherited from class CommandHandler
eval, eval, evalNative, findCategory, findCommand, getBaseCategory, getCategories, lookup, registerCategory, registerCommand, run, unregisterCategory, unregisterCommand, walkModifier and TypeMethodDescriptionvoidvoidvoidevalNative(String line, boolean bell) findCategory(String name) findCommand(String name) voidregisterCategory(CommandHandler.Category category) voidregisterCommand(String name, Command command) voidrun()voidunregisterCategory(CommandHandler.Category category) unregisterCommand(String name) voidwalk(CommandHandler.CommandWalk callback) Walk all categories Categories are sorted in the order they are added.
-
Constructor Details
-
StdCommandHandler
public StdCommandHandler(boolean readCommands) -
StdCommandHandler
-
StdCommandHandler
-
StdCommandHandler
protected StdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, boolean readCommands) -
StdCommandHandler
protected StdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, InputStream stream) -
StdCommandHandler
protected StdCommandHandler(List<CommandHandler.Category> categories, CommandCategory baseCategory, BufferedReader reader)
-
-
Method Details
-
bell
public void bell()Description copied from class:CommandHandlerIf supported, sends a bell signal to the console- Specified by:
bellin classCommandHandler
-
clear
Description copied from class:CommandHandlerCleans the console- Specified by:
clearin classCommandHandler- Throws:
IOException- Internal Error
-
readLine
Description copied from class:CommandHandlerReads a line from the console- Specified by:
readLinein classCommandHandler- Returns:
- command line
- Throws:
IOException- Internal Error
-
ofHandler
-
ofHandler
-
ofHandler
-