Class EdtCommandWrapper
java.lang.Object
com.e1c.g5.v8.dt.internal.cli.api.EdtCommandWrapper
- All Implemented Interfaces:
ICliCommand,org.apache.felix.service.command.Function
public class EdtCommandWrapper
extends Object
implements org.apache.felix.service.command.Function, ICliCommand
Decorator for a particular command of a
command provider. Exposes itself as a Apache Felix GoGo
command via Function interface, redirects control to the wrapped command via reflection. Allows to implement
special features which would be impossible if ICliCommand were registered as a service directly:
1. kebab-case suport;
2. Argument annotation support;
3. argument types fine tuning (e.g. better support of array types).-
Constructor Summary
ConstructorsConstructorDescriptionEdtCommandWrapper(com.e1c.g5.v8.dt.internal.cli.api.CommandRegistry registry, ICliCommand commandProvider, String commandName, String namespace) Creates a new command wrapper. -
Method Summary
Modifier and TypeMethodDescriptionReturns the command name this command is registered under.Returns the wrapped command provider.Returns the namespace this command is registered under.
-
Constructor Details
-
EdtCommandWrapper
public EdtCommandWrapper(com.e1c.g5.v8.dt.internal.cli.api.CommandRegistry registry, ICliCommand commandProvider, String commandName, String namespace) Creates a new command wrapper.- Parameters:
registry- command registry this command is a part of, cannot benull.commandProvider- target command provider, cannot benull.commandName- the name under which the command is registered (typically in kebab-case). Cannot benull.namespace- namespace under which the script is registered. May benullor blank, in which casethe default namespaceis assumed.
-
-
Method Details
-
execute
public Object execute(org.apache.felix.service.command.CommandSession session, List<Object> arguments) throws Exception - Specified by:
executein interfaceorg.apache.felix.service.command.Function- Throws:
Exception
-
getCommandProvider
Returns the wrapped command provider.- Returns:
- the wrapped command provider.
-
getCommandName
Returns the command name this command is registered under.- Returns:
- the command name this command is registered under.
-
getNamespace
Returns the namespace this command is registered under.- Returns:
- the namespace this command is registered under.
-