org.crsh.cli.impl.lang
Class MethodDescriptor<T>
java.lang.Object
org.crsh.cli.descriptor.CommandDescriptor<Instance<T>>
org.crsh.cli.impl.lang.ObjectCommandDescriptor<T>
org.crsh.cli.impl.lang.MethodDescriptor<T>
class MethodDescriptor<T>
- extends ObjectCommandDescriptor<T>
Methods inherited from class org.crsh.cli.descriptor.CommandDescriptor |
completer, getArgument, getArguments, getDepth, getDescription, getLongOptionNames, getName, getOption, getOptionNames, getOptions, getParameters, getShortOptionNames, getSubordinate, getUsage, matcher, print, printMan, printUsage, resolveOption |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
owner
private final ClassDescriptor<T> owner
- .
method
private final Method method
- .
MethodDescriptor
public MethodDescriptor(ClassDescriptor<T> owner,
Method method,
String name,
Description info)
throws IntrospectionException
- Throws:
IntrospectionException
addParameter
protected void addParameter(ParameterDescriptor parameter)
throws IntrospectionException,
NullPointerException,
IllegalArgumentException
- Description copied from class:
CommandDescriptor
- Add a parameter to the command.
- Overrides:
addParameter
in class CommandDescriptor<Instance<T>>
- Parameters:
parameter
- the parameter to add
- Throws:
IntrospectionException
- any introspection exception that would prevent the parameter to be added
NullPointerException
- if the parameter is null
IllegalArgumentException
- if the parameter is already associated with another command
getOwner
public CommandDescriptor<Instance<T>> getOwner()
- Specified by:
getOwner
in class CommandDescriptor<Instance<T>>
getSubordinates
public Map<String,? extends CommandDescriptor<Instance<T>>> getSubordinates()
- Specified by:
getSubordinates
in class CommandDescriptor<Instance<T>>
- Returns:
- the command subordinates as a map.
getMethod
public Method getMethod()
getInvoker
public CommandInvoker<Instance<T>,?> getInvoker(InvocationMatch<Instance<T>> match)
- Specified by:
getInvoker
in class CommandDescriptor<Instance<T>>
bind
static void bind(InvocationMatch<?> match,
Iterable<ParameterDescriptor> parameters,
Object target,
Object[] args)
throws SyntaxException,
InvocationException
- Throws:
SyntaxException
InvocationException
getInvoker2
private <V> ObjectCommandInvoker<T,V> getInvoker2(InvocationMatch<Instance<T>> match,
Class<V> returnType)
Copyright © 2015 eXo Platform SAS. All Rights Reserved.