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


Field Summary
private static BitSet A
          .
private  int arity
          .
private static BitSet B
          .
private  List<String> names
          .
 
Constructor Summary
OptionDescriptor(Object binding, ParameterType<?> type, List<String> names, Description info, boolean required, boolean password, boolean unquote, Class<? extends Completer> completerType, Annotation annotation)
           
 
Method Summary
private static void checkChar(String s, int index, BitSet authorized)
           
 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, getBinding, getCompleterType, getDeclaredType, getDescription, getMultiplicity, getType, getUsage, isMultiValued, isPassword, isRequired, isSingleValued, isUnquote, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

A

private static final BitSet A
.


B

private static final BitSet B
.


arity

private final int arity
.


names

private final List<String> names
.

Constructor Detail

OptionDescriptor

public OptionDescriptor(Object binding,
                        ParameterType<?> type,
                        List<String> names,
                        Description info,
                        boolean required,
                        boolean password,
                        boolean unquote,
                        Class<? extends Completer> completerType,
                        Annotation annotation)
                 throws IllegalValueTypeException,
                        IllegalParameterException
Throws:
IllegalValueTypeException
IllegalParameterException
Method Detail

checkChar

private static void checkChar(String s,
                              int index,
                              BitSet authorized)
                       throws IllegalParameterException
Throws:
IllegalParameterException

getArity

public int getArity()

getNames

public List<String> getNames()

parse

public Object parse(List<String> values)
             throws SyntaxException
Specified by:
parse in class ParameterDescriptor
Throws:
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 © 2014 eXo Platform SAS. All Rights Reserved.