org.crsh.cli.descriptor
Class OptionDescriptor

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

public class OptionDescriptor
extends ParameterDescriptor


Constructor Summary
OptionDescriptor(org.crsh.cli.impl.ParameterType<?> type, List<String> names, Description info, boolean required, boolean password, boolean unquote, Class<? extends Completer> completerType, Annotation annotation)
           
 
Method Summary
 int getArity()
           
 List<String> getNames()
           
 Object parse(List<String> values)
           
 void printUsage(Appendable writer)
          Prints the option names as an alternative of switches surrounded by a square brace, for instance: "[-f --foo]"
 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

OptionDescriptor

public OptionDescriptor(org.crsh.cli.impl.ParameterType<?> type,
                        List<String> names,
                        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

getArity

public int getArity()

getNames

public List<String> getNames()

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 option names as an alternative of switches surrounded by a square brace, for instance: "[-f --foo]"

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.