org.crsh.cmdline
Class MethodDescriptor<T>

java.lang.Object
  extended by org.crsh.cmdline.CommandDescriptor<T,MethodArgumentBinding>
      extended by org.crsh.cmdline.MethodDescriptor<T>

public class MethodDescriptor<T>
extends CommandDescriptor<T,MethodArgumentBinding>

Version:
$Revision$
Author:
Julien Viet

Field Summary
private static org.slf4j.Logger log
          .
private static Set<String> MAIN_SINGLETON
          .
private  Method method
          .
private  ClassDescriptor<T> owner
          .
private  int size
          .
 
Constructor Summary
MethodDescriptor(ClassDescriptor<T> owner, Method method, String name, Description info)
           
 
Method Summary
 OptionDescriptor<?> findOption(String name)
          Find an command option by its name.
 Method getMethod()
           
 ParameterDescriptor<MethodArgumentBinding> getParameter(int index)
          Returns the parameter descriptor for the specified method parameter index.
 Map<String,? extends CommandDescriptor<T,?>> getSubordinates()
          Returns the command subordinates as a map.
 Class<T> getType()
           
 void printMan(Appendable writer)
           
 void printUsage(Appendable writer)
           
 
Methods inherited from class org.crsh.cmdline.CommandDescriptor
addParameter, getArgument, getArguments, getDescription, getLongOptionNames, getName, getOption, getOptionNames, getOptions, getParameters, getShortOptionNames, getUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN_SINGLETON

private static final Set<String> MAIN_SINGLETON
.


log

private static final org.slf4j.Logger log
.


owner

private final ClassDescriptor<T> owner
.


method

private final Method method
.


size

private final int size
.

Constructor Detail

MethodDescriptor

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

getParameter

public ParameterDescriptor<MethodArgumentBinding> 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

getSubordinates

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

Specified by:
getSubordinates in class CommandDescriptor<T,MethodArgumentBinding>
Returns:
the subordinates

getMethod

public Method getMethod()

getType

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

findOption

public OptionDescriptor<?> findOption(String name)
Description copied from class: CommandDescriptor
Find an command option by its name.

Specified by:
findOption in class CommandDescriptor<T,MethodArgumentBinding>
Parameters:
name - the option name
Returns:
the option

printUsage

public void printUsage(Appendable writer)
                throws IOException
Specified by:
printUsage in class CommandDescriptor<T,MethodArgumentBinding>
Throws:
IOException

printMan

public void printMan(Appendable writer)
              throws IOException
Specified by:
printMan in class CommandDescriptor<T,MethodArgumentBinding>
Throws:
IOException


Copyright © 2012 eXo Platform SAS. All Rights Reserved.