org.crsh.cli.descriptor
Class OptionDescriptor
java.lang.Object
org.crsh.cli.descriptor.ParameterDescriptor
org.crsh.cli.descriptor.OptionDescriptor
- Direct Known Subclasses:
- BoundOptionDescriptor
-
public class OptionDescriptor
- extends ParameterDescriptor
-
Field Summary |
private static BitSet |
A
. |
private int |
arity
. |
private static BitSet |
B
. |
private List<String> |
names
. |
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, 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 |
A
private static final BitSet A
-
.
B
private static final BitSet B
-
.
arity
private final int arity
-
.
names
private final List<String> names
-
.
OptionDescriptor
public OptionDescriptor(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
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 © 2015 eXo Platform SAS. All Rights Reserved.