Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package bpiwowar.argparser;
An object that represent one option of the command line

Benjamin Piwowarski
 class Option {
The result holder
 	Handler handler = null;

Should this record be specified in the command line?
 	boolean mandatory;

Mandatory status
Was in the command line
 	boolean processed;

The list of possible names for the option
Help message
 	String helpMessage = null;

Is this option active?
 	private boolean activated = true;

Groups to activate if the option is set
Creates a new option

nameList The list of command line
handler The handler/holder
mandatory If the option is mandatory
helpMsg The help message
valueDesc The description for this value
 	public Option(OptionName[] nameListHandler handlerboolean mandatory,
 			String helpMsgString valueDesc) {
 		for (OptionName optionName : nameList)
 		this. = handler;
 		this. = mandatory;
 		this. = helpMsg;

Default constructor
 	public Option() {

mandatory the mandatory to set
 	public void setMandatory(boolean mandatory) {
 		this. = mandatory;

the mandatory
 	public boolean isMandatory() {
 		return ;

processed the wasProcessed to set
	public void setProcessed(boolean processed) {
		this. = processed;

the wasProcessed
	public boolean isProcessed() {
		return ;

Get the different option names

The string
	public String getNames() {
		String optionInfo = "";
		for (OptionName ndesc : ) {
			if (!optionInfo.equals(""))
				optionInfo += ",";
			optionInfo +=;
		return optionInfo;
	public void setActive(boolean activated) {
		this. = activated;
	public boolean isActivated() {
		return ;
	public void setActivators(Collection<Stringlist) {
New to GrepCode? Check out our FAQ X