org.crsh.cli.descriptor
Class ArgumentDescriptor

java.lang.Object
  extended by org.crsh.cli.descriptor.ParameterDescriptor
      extended by org.crsh.cli.descriptor.ArgumentDescriptor

public class ArgumentDescriptor
extends ParameterDescriptor


Constructor Summary
ArgumentDescriptor(String name, org.crsh.cli.impl.ParameterType<?> type, Description info, boolean required, boolean password, boolean unquote, Class<? extends Completer> completerType, Annotation annotation)
           
 
Method Summary
 String getName()
          Returns the argument name, that can be null.
 Object parse(List<String> values)
           
 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.cli.descriptor.ParameterDescriptor
getAnnotation, getCompleterType, getDeclaredType, getDescription, getMultiplicity, getType, getUsage, isMultiValued, isPassword, isRequired, isSingleValued, isUnquote, parse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgumentDescriptor

public ArgumentDescriptor(String name,
                          org.crsh.cli.impl.ParameterType<?> type,
                          Description info,
                          boolean required,
                          boolean password,
                          boolean unquote,
                          Class<? extends Completer> completerType,
                          Annotation annotation)
                   throws org.crsh.cli.impl.descriptor.IllegalValueTypeException,
                          org.crsh.cli.impl.descriptor.IllegalParameterException
Throws:
org.crsh.cli.impl.descriptor.IllegalValueTypeException
org.crsh.cli.impl.descriptor.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

parse

public Object parse(List<String> values)
             throws org.crsh.cli.impl.SyntaxException
Specified by:
parse in class ParameterDescriptor
Throws:
org.crsh.cli.impl.SyntaxException

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
Parameters:
writer - the writer to print to
Throws:
IOException - any io exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 eXo Platform SAS. All Rights Reserved.