org.crsh.cmdline
Class ArgumentDescriptor<B extends TypeBinding>

java.lang.Object
  extended by org.crsh.cmdline.ParameterDescriptor<B>
      extended by org.crsh.cmdline.ArgumentDescriptor<B>

public class ArgumentDescriptor<B extends TypeBinding>
extends ParameterDescriptor<B>

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
ArgumentDescriptor(B binding, String name, Type javaType, Description info, boolean required, boolean password, Class<? extends Completer> completerType, Annotation annotation)
           
 
Method Summary
 String getName()
          Returns the argument name, that can be null.
 void printUsage(Appendable writer)
          Prints the argument: Single valued arguments use the "$arg" pattern. Multi valued arguments use the "...
 String toString()
           
 
Methods inherited from class org.crsh.cmdline.ParameterDescriptor
getAnnotation, getBinding, getCompleterType, getDescription, getJavaType, getJavaValueType, getMultiplicity, getOwner, getType, getUsage, isPassword, isRequired, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgumentDescriptor

public ArgumentDescriptor(B binding,
                          String name,
                          Type javaType,
                          Description info,
                          boolean required,
                          boolean password,
                          Class<? extends Completer> completerType,
                          Annotation annotation)
                   throws IllegalValueTypeException,
                          IllegalParameterException
Throws:
IllegalValueTypeException
IllegalParameterException
Method Detail

getName

public String getName()
Returns the argument name, that can be null. This value is used for display capabilities and does not play a role when a command line is parsed.

Returns:
the argument name

printUsage

public void printUsage(Appendable writer)
                throws IOException
Prints the argument: Where $arg is the value "arg" or the argument name when it is not null.

Specified by:
printUsage in class ParameterDescriptor<B extends TypeBinding>
Parameters:
writer - the writer to print to
Throws:
IOException - any io exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 eXo Platform SAS. All Rights Reserved.