View Javadoc

1   /***
2    * 
3    */
4   package de.cohesion.bssh;
5   
6   /***
7    * @author schulzs
8    */
9   public abstract class Option {
10  
11  	private final String key;
12  
13  	private final int arity;
14  	
15  	private boolean active;
16  	
17  	private String helpText;
18  	
19  	public Option(final String key, int arity, final String helpText) {
20  		this.key = key;
21  		this.arity = arity;
22  		this.helpText = helpText;
23  		active = false;
24  	}
25  
26  	protected abstract void parse(final String raw) throws ParseException;
27  	
28  	public boolean isActive() {
29  		return active;
30  	}
31  	
32  	protected void setActive(boolean active) {
33  		this.active = active;
34  	}
35  	
36  	public String getKey() {
37  		return key;
38  	}
39  	
40  	public int getArity() {
41  		return arity;
42  	}
43  	
44  	public String getHelpText() {
45  		return helpText;
46  	}
47  
48  }