View Javadoc

1   /*
2    * Copyright (C) 2003-2006 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, visit
19   * http://www.gnu.org/licenses/gpl.html or write to the Free Software
20   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21   */
22  package de.fu_berlin.ties.xml;
23  
24  /***
25   * Type-safe enumeration of the three variaties of tags employed for XML
26   * adjustment.
27   *
28   * @author Christian Siefkes
29   * @version $Revision: 1.4 $, $Date: 2006/10/21 16:04:29 $, $Author: siefkes $
30   */
31  public final class TagVariety {
32  
33      /***
34       * Constant for the most common tag variety, marking all tags that
35       * pre-existed in the input data.
36       */
37      public static final TagVariety REGULAR = new TagVariety("regular");
38  
39      /***
40       * Constant for start tags that were created when splitting a tag. Tags of
41       * this variety that be freely moved within a tag series, but the cannot
42       * be moved to the next series (if required, they must be split again).
43       */
44      public static final TagVariety CONTINUATION =
45          new TagVariety("continuation");
46  
47      /***
48       * Constant for tentative start tags that were created when an end tag is
49       * followed by another end tag of the same type without a start tag of this
50       * type between them. The tentative tag replaces the missing start tag,
51       * it can be freely moved between tag series when required.
52       */
53      public static final TagVariety TENTATIVE = new TagVariety("tentative");
54  
55      /***
56       * The name of this tag variety, printed by the {@link #toString()} method.
57       */
58      private final String name;
59  
60      /***
61       * Private constructor to prevent creation of further instances.
62       * The static constants defined in this class are the only instantiations.
63       *
64       * @param varietyName the name of this tag variety, to be printed by the
65       * {@link #toString()} method
66       */
67      private TagVariety(final String varietyName) {
68          super();
69          name = varietyName;
70      }
71  
72      /***
73       * Returns a string representation of this object.
74       *
75       * @return a textual representation
76       */
77      public String toString() {
78          return name;
79      }
80  
81  }