Package com.github.javacliparser
Class AbstractOption
- java.lang.Object
-
- com.github.javacliparser.AbstractOption
-
- All Implemented Interfaces:
Option
,Serializable
- Direct Known Subclasses:
AbstractClassOption
,AbstractClassOption
,FlagOption
,FloatOption
,IntOption
,ListOption
,MultiChoiceOption
,StringOption
public abstract class AbstractOption extends Object implements Option
Abstract option.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected char
cliChar
Command line interface text of this option.static char[]
illegalNameCharacters
Array of characters not valid to use in option names.protected String
name
Name of this option.protected String
purpose
Text of the purpose of this option.
-
Constructor Summary
Constructors Constructor Description AbstractOption(String name, char cliChar, String purpose)
Creates a new instance of an abstract option given its class name, command line interface text and its purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Option
copy()
Gets a copy of this optionchar
getCLIChar()
Gets the Command Line Interface text of this optionString
getName()
Gets the name of this optionString
getPurpose()
Gets the purpose of this optionString
getStateString()
Gets the state of this option in human readable formstatic boolean
nameIsLegal(String optionName)
Gets whether the name is valid or not.void
resetToDefault()
Resets this option to the default value-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.javacliparser.Option
getDefaultCLIString, getValueAsCLIString, setValueViaCLIString
-
-
-
-
Field Detail
-
illegalNameCharacters
public static final char[] illegalNameCharacters
Array of characters not valid to use in option names.
-
name
protected String name
Name of this option.
-
cliChar
protected char cliChar
Command line interface text of this option.
-
purpose
protected String purpose
Text of the purpose of this option.
-
-
Constructor Detail
-
AbstractOption
public AbstractOption(String name, char cliChar, String purpose)
Creates a new instance of an abstract option given its class name, command line interface text and its purpose.- Parameters:
name
- the name of this optioncliChar
- the command line interface textpurpose
- the text describing the purpose of this option
-
-
Method Detail
-
nameIsLegal
public static boolean nameIsLegal(String optionName)
Gets whether the name is valid or not.- Parameters:
optionName
- the name of the option- Returns:
- true if the name that not contain any illegal character
-
getName
public String getName()
Description copied from interface:Option
Gets the name of this option
-
getCLIChar
public char getCLIChar()
Description copied from interface:Option
Gets the Command Line Interface text of this option- Specified by:
getCLIChar
in interfaceOption
- Returns:
- the Command Line Interface text
-
getPurpose
public String getPurpose()
Description copied from interface:Option
Gets the purpose of this option- Specified by:
getPurpose
in interfaceOption
- Returns:
- the purpose of this option
-
resetToDefault
public void resetToDefault()
Description copied from interface:Option
Resets this option to the default value- Specified by:
resetToDefault
in interfaceOption
-
getStateString
public String getStateString()
Description copied from interface:Option
Gets the state of this option in human readable form- Specified by:
getStateString
in interfaceOption
- Returns:
- the string with state of this option in human readable form
-
-