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

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

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

Version:
$Revision$
Author:
Julien Viet

Field Summary
private  int arity
          .
private  List<String> names
          .
 
Fields inherited from class org.crsh.cmdline.ParameterDescriptor
owner
 
Constructor Summary
OptionDescriptor(B binding, Type javaType, 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.cmdline.ParameterDescriptor
getAnnotation, getBinding, getCompleterType, getDescription, getJavaType, getJavaValueType, getMultiplicity, getOwner, 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

arity

private final int arity
.


names

private final List<String> names
.

Constructor Detail

OptionDescriptor

public OptionDescriptor(B binding,
                        Type javaType,
                        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

getArity

public int getArity()

getNames

public List<String> getNames()

parse

public Object parse(List<String> values)
             throws CmdSyntaxException
Specified by:
parse in class ParameterDescriptor<B extends TypeBinding>
Throws:
CmdSyntaxException

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