@Component public class CommandFactory extends Object
During the initialization, the factory performs a path scan in
com.cksource.ckfinder.command
package. All the discovered
command classes are automatically registered.
Modifier and Type | Field and Description |
---|---|
protected AutowireCapableBeanFactory |
beanFactory |
protected Map<String,Class<? extends Command>> |
commandClassMap |
Constructor and Description |
---|
CommandFactory()
Constructs the command factory.
|
Modifier and Type | Method and Description |
---|---|
Command |
getCommand(String commandName)
Returns a new instance of concrete
Command to handle the current
HTTP request. |
CommandFactory |
registerCommand(Class<? extends Command> commandClass)
Registers the command class in CKFinder.
|
@Autowired protected AutowireCapableBeanFactory beanFactory
public CommandFactory() throws ClassNotFoundException
ClassNotFoundException
- in case if the command class cannot be foundpublic CommandFactory registerCommand(Class<? extends Command> commandClass)
commandClass
- command class to registerpublic Command getCommand(String commandName) throws IllegalAccessException, InstantiationException
Command
to handle the current
HTTP request.commandName
- command name of requested command instancenull
if command
with given name could not be foundIllegalAccessException
- if the command cannot be instantiatedInstantiationException
- if the command cannot be instantiatedCopyright © 2007 – 2019 CKSource - Frederico Knabben. All rights reserved.