View Javadoc

1   /*
2    * This file is part of hyphenType. hyphenType is free software: you can
3    * redistribute it and/or modify it under the terms of the GNU General Public
4    * License as published by the Free Software Foundation, either version 3 of the
5    * License, or (at your option) any later version. hyphenType is distributed in
6    * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
7    * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
8    * the GNU General Public License for more details. You should have received a
9    * copy of the GNU General Public License along with hyphenType. If not, see
10   * <http://www.gnu.org/licenses/>.
11   */
12  // TODO FINISH THIS!!
13  package org.hyphenType.exit;
14  
15  /**
16   * The base exception that is trapped when a main class is executed and that can
17   * be used to find exit codes. When an exception of this class or of a subclass
18   * of this class is thrown during the execution of a main class, hyphenType will
19   * try to find an exit status constant associated with the exception and use the
20   * arguments of this exception to format an error message. Association between
21   * exit status constants and exceptions is created using the
22   * {@link ExitStatusConstant#equals(Object)} property, in the annotation that
23   * decorates an exit status constant.
24   * 
25   * @author akira
26   */
27  public class ExitMessageException extends Exception {
28  
29      /**
30       * Serialization UID.
31       */
32      private static final long serialVersionUID = 4994379172754714249L;
33  
34      private String[] arguments;
35  
36      /**
37       * This constructor requires the caller to provide textual data that
38       * will be used to format error messages in exit status constants.
39       * 
40       * @param arguments Arguments to format error messages.
41       */
42      public ExitMessageException(String... arguments) {
43          this.arguments = arguments;
44      }
45  
46      /**
47       * Arguments to format error messages.
48       * 
49       * @return Arguments to format error messages
50       */
51      public String[] getArguments() {
52          return arguments;
53      }
54  }