View Javadoc

1   /*
2    * Copyright 2014 Theo Willows
3    *
4    * This file is part of JArgP.
5    *
6    * JArgP is free software: you can redistribute it and/or modify it under the
7    * terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation, either version 3 of the License, or (at your option) any
9    * later version.
10   *
11   * JArgP is distributed in the hope that it will be useful, but WITHOUT ANY
12   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13   * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
14   * details.
15   *
16   * You should have received a copy of the GNU Lesser General Public License
17   * along with JArgP.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package com.munkei.exception;
21  
22  import java.text.MessageFormat;
23  
24  /**
25   *
26   * @author Theo 'Biffen' Willows <theo@willows.se>
27   *
28   * @since 0.0.1
29   */
30  public class NoSuchOptionException
31    extends Exception {
32  
33    private static final long serialVersionUID = 1L;
34  
35    private final String option;
36  
37    public NoSuchOptionException(String option) {
38      super(MessageFormat.format("No such option ''{0}''", option));
39      this.option = option;
40    }
41  
42    public String getOption() {
43      return option;
44    }
45  
46  }