Interface CommandCatalog
- All Known Implementing Classes:
CommandCatalog.DefaultCommandCatalog
public interface CommandCatalog
Interface defining contract to handle existing
CommandRegistrations.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionGets allCommandRegistrations mapped with their names.static CommandCatalogof()Gets an instance of a defaultCommandCatalog.static CommandCatalogof(Collection<CommandResolver> resolvers, ShellContext shellContext) Gets an instance of a defaultCommandCatalog.voidregister(CommandRegistration... registration) Register aCommandRegistration.voidunregister(String... commandName) Unregister aCommandRegistrationby its command name.voidunregister(CommandRegistration... registration) Unregister aCommandRegistration.
-
Method Details
-
register
Register aCommandRegistration.- Parameters:
registration- the command registration
-
unregister
Unregister aCommandRegistration.- Parameters:
registration- the command registration
-
unregister
Unregister aCommandRegistrationby its command name.- Parameters:
commandName- the command name
-
getRegistrations
Map<String,CommandRegistration> getRegistrations()Gets allCommandRegistrations mapped with their names. Returned map is a copy and cannot be used to register new commands.- Returns:
- all command registrations
-
of
Gets an instance of a defaultCommandCatalog.- Returns:
- default command catalog
-
of
Gets an instance of a defaultCommandCatalog.- Parameters:
resolvers- the command resolversshellContext- the shell context- Returns:
- default command catalog
-