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

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
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
 

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 © 2011 eXo Platform SAS. All Rights Reserved.