Class FilterCommandRegistry


  • public class FilterCommandRegistry
    extends Object
    Registry for built-in filters
    Since:
    4.6
    • Constructor Detail

      • FilterCommandRegistry

        public FilterCommandRegistry()
    • Method Detail

      • register

        public static FilterCommandFactory register​(String filterCommandName,
                                                    FilterCommandFactory factory)
        Register a FilterCommandFactory responsible for creating FilterCommands for a certain command name. If the factory f1 is registered for the name "jgit://builtin/x" then a call to getCommand("jgit://builtin/x", ...) will call f1(...) to create a new instance of FilterCommand
        Parameters:
        filterCommandName - the command name for which this factory is registered
        factory - the factory responsible for creating FilterCommands for the specified name
        Returns:
        the previous factory associated with commandName, or null if there was no mapping for commandName
      • unregister

        public static FilterCommandFactory unregister​(String filterCommandName)
        Unregister the FilterCommandFactory registered for the given command name
        Parameters:
        filterCommandName - the FilterCommandFactory's filter command name
        Returns:
        the previous factory associated with filterCommandName, or null if there was no mapping for commandName
      • isRegistered

        public static boolean isRegistered​(String filterCommandName)
        Check whether any FilterCommandFactory is registered for a given command name
        Parameters:
        filterCommandName - the name for which the registry should be checked
        Returns:
        true if any factory was registered for the name
      • getRegisteredFilterCommands

        public static Set<String> getRegisteredFilterCommands()
        Get registered filter commands
        Returns:
        Set of commandNames for which a FilterCommandFactory is registered