Top Description Fields Constructors Methods
org.eclipse.jgit.attributes

public Class FilterCommandRegistry

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.util.Map, .Set, java.util.concurrent.ConcurrentHashMap, org.eclipse.jgit.lib.Repository

Registry for built-in filters
Since
4.6

Field Summary

Modifier and TypeField and Description
private static Map<String, FilterCommandFactory>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static FilterCommand

Returns:

the command if a command could be created or null if there was no factory registered for that name
createFilterCommand
(String
The name for which a new org.eclipse.jgit.attributes.FilterCommand should be created
filterCommandName
,
Repository
the repository this command should work on
db
,
InputStream in, OutputStream out)

Create a new org.eclipse.jgit.attributes.FilterCommand for the given name.

public static Set<String>

Returns:

Set of commandNames for which a org.eclipse.jgit.attributes.FilterCommandFactory is registered
getRegisteredFilterCommands
()

Get registered filter commands

public static boolean

Returns:

true if any factory was registered for the name
isRegistered
(String
the name for which the registry should be checked
filterCommandName
)

Check whether any org.eclipse.jgit.attributes.FilterCommandFactory is registered for a given command name

public static FilterCommandFactory

Returns:

the previous factory associated with commandName, or null if there was no mapping for commandName
register
(String
the command name for which this factory is registered
filterCommandName
,
FilterCommandFactory
the factory responsible for creating org.eclipse.jgit.attributes.FilterCommands for the specified name
factory
)

Register a org.eclipse.jgit.attributes.FilterCommandFactory responsible for creating org.eclipse.jgit.attributes.FilterCommands for a certain command name.

public static FilterCommandFactory

Returns:

the previous factory associated with filterCommandName, or null if there was no mapping for commandName
unregister
(String
the FilterCommandFactory's filter command name
filterCommandName
)

Unregister the org.eclipse.jgit.attributes.FilterCommandFactory registered for the given command name

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterCommandRegistryback to summary
private static Map<String, FilterCommandFactory> filterCommandRegistry

Constructor Detail

FilterCommandRegistryback to summary
public FilterCommandRegistry()

Method Detail

createFilterCommandback to summary
public static FilterCommand createFilterCommand(String filterCommandName, Repository db, InputStream in, OutputStream out) throws IOException

Create a new org.eclipse.jgit.attributes.FilterCommand for the given name. A factory must be registered for the name in advance.

Parameters
filterCommandName:String

The name for which a new org.eclipse.jgit.attributes.FilterCommand should be created

db:Repository

the repository this command should work on

in:InputStream

the java.io.InputStream this org.eclipse.jgit.attributes.FilterCommand should read from

out:OutputStream

the java.io.OutputStream this org.eclipse.jgit.attributes.FilterCommand should write to

Returns:FilterCommand

the command if a command could be created or null if there was no factory registered for that name

Exceptions
IOException:
if an IO error occurred
getRegisteredFilterCommandsback to summary
public static Set<String> getRegisteredFilterCommands()

Get registered filter commands

Returns:Set<String>

Set of commandNames for which a org.eclipse.jgit.attributes.FilterCommandFactory is registered

isRegisteredback to summary
public static boolean isRegistered(String filterCommandName)

Check whether any org.eclipse.jgit.attributes.FilterCommandFactory is registered for a given command name

Parameters
filterCommandName:String

the name for which the registry should be checked

Returns:boolean

true if any factory was registered for the name

registerback to summary
public static FilterCommandFactory register(String filterCommandName, FilterCommandFactory factory)

Register a org.eclipse.jgit.attributes.FilterCommandFactory responsible for creating org.eclipse.jgit.attributes.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 org.eclipse.jgit.attributes.FilterCommand

Parameters
filterCommandName:String

the command name for which this factory is registered

factory:FilterCommandFactory

the factory responsible for creating org.eclipse.jgit.attributes.FilterCommands for the specified name

Returns:FilterCommandFactory

the previous factory associated with commandName, or null if there was no mapping for commandName

unregisterback to summary
public static FilterCommandFactory unregister(String filterCommandName)

Unregister the org.eclipse.jgit.attributes.FilterCommandFactory registered for the given command name

Parameters
filterCommandName:String

the FilterCommandFactory's filter command name

Returns:FilterCommandFactory

the previous factory associated with filterCommandName, or null if there was no mapping for commandName