org.crsh.cli.impl.lang
Class MethodDescriptor<T>

java.lang.Object
  extended by org.crsh.cli.descriptor.CommandDescriptor<T>
      extended by org.crsh.cli.impl.descriptor.CommandDescriptorImpl<T>
          extended by org.crsh.cli.impl.lang.MethodDescriptor<T>

 class MethodDescriptor<T>
extends CommandDescriptorImpl<T>


Field Summary
private  Method method
          .
private  ClassDescriptor<T> owner
          .
private  int size
          .
 
Constructor Summary
MethodDescriptor(ClassDescriptor<T> owner, Method method, String name, Description info)
           
 
Method Summary
protected  void addParameter(ParameterDescriptor parameter)
          Add a parameter to the command.
 CommandInvoker<T> getInvoker(InvocationMatch<T> _match)
           
 Method getMethod()
           
 CommandDescriptor<T> getOwner()
           
(package private)  ParameterDescriptor getParameter(int index)
          Returns the parameter descriptor for the specified method parameter index.
 CommandDescriptorImpl<T> getSubordinate(String name)
           
 Map<String,? extends CommandDescriptorImpl<T>> getSubordinates()
          Returns the command subordinates as a map.
 Class<T> getType()
           
 
Methods inherited from class org.crsh.cli.impl.descriptor.CommandDescriptorImpl
completer, completer, invoker, invoker
 
Methods inherited from class org.crsh.cli.descriptor.CommandDescriptor
findOption, getArgument, getArguments, getDepth, getDescription, getLongOptionNames, getName, getOption, getOptionNames, getOptions, getParameters, getShortOptionNames, getUsage, printMan, printUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

private final ClassDescriptor<T> owner
.


method

private final Method method
.


size

private final int size
.

Constructor Detail

MethodDescriptor

public MethodDescriptor(ClassDescriptor<T> owner,
                        Method method,
                        String name,
                        Description info)
                 throws IntrospectionException
Throws:
IntrospectionException
Method Detail

getParameter

ParameterDescriptor getParameter(int index)
                           throws IndexOutOfBoundsException
Returns the parameter descriptor for the specified method parameter index.

Parameters:
index - the parameter index
Returns:
the parameter descriptor or null if none can be bound
Throws:
IndexOutOfBoundsException - if the index is not valid

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<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<T> getOwner()
Specified by:
getOwner in class CommandDescriptor<T>

getSubordinates

public Map<String,? extends CommandDescriptorImpl<T>> getSubordinates()
Description copied from class: CommandDescriptor
Returns the command subordinates as a map.

Specified by:
getSubordinates in class CommandDescriptorImpl<T>
Returns:
the subordinates

getSubordinate

public CommandDescriptorImpl<T> getSubordinate(String name)
Specified by:
getSubordinate in class CommandDescriptorImpl<T>

getMethod

public Method getMethod()

getType

public Class<T> getType()
Specified by:
getType in class CommandDescriptor<T>

getInvoker

public CommandInvoker<T> getInvoker(InvocationMatch<T> _match)
Specified by:
getInvoker in class CommandDescriptorImpl<T>


Copyright © 2014 eXo Platform SAS. All Rights Reserved.