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

Author(s):
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

Parameters:
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..add(optionName);
 		this. = handler;
 		this. = mandatory;
 		this. = helpMsg;
 	}

Default constructor
 
 	public Option() {
 	}

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

Returns:
the mandatory
 
 	public boolean isMandatory() {
 		return ;
 	}

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

Returns:
the wasProcessed
	public boolean isProcessed() {
		return ;
	}

Get the different option names

Returns:
The string
	public String getNames() {
		String optionInfo = "";
		for (OptionName ndesc : ) {
			if (!optionInfo.equals(""))
				optionInfo += ",";
			optionInfo += ndesc.name;
		}
		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