001/* DTDConstants.java --
002   Copyright (C) 2005 Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038
039package javax.swing.text.html.parser;
040
041/**
042 * <p>This class defines the SGML basic types, used for describing HTML 4.01
043 * at <a href="http://www.w3.org/TR/html4/types.html"
044 * >http://www.w3.org/TR/html4/types.html</a>. Not all constants,
045 * defined here, are actually used in HTML 4.01 SGML specification. Some others
046 * are defined just as part of the required implementation.
047 * </p>
048 * <p>
049 * If you need more information about SGML DTD documents,
050 * the author suggests to read SGML tutorial on
051 * <a href="http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html"
052 * >http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html</a>.
053 * We also recommend Goldfarb C.F (1991) <i>The SGML Handbook</i>,
054 * Oxford University Press, 688 p, ISBN: 0198537379.
055 * </p>
056 *
057 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
058 */
059public interface DTDConstants
060{
061  /* ----- The data types, used in HTML 4.01 SGML definition: ---- */
062
063  /**
064   * The CDATA (Character data) constant, specifes the content model,
065   * consisting of characters only. In SGML for HTML 4.01, the character
066   * entities must be replaced by characters, the line feeds must be
067   * ignored and any number of the subsequent carriage returns or tabs
068   * must be replaced by a single space.
069   */
070  int CDATA = 1;
071
072  /**
073   *  The EMPTY constant, means the element with no content.
074   */
075  int EMPTY = 17;
076
077  /**
078   * The ID constant, means that the token is the unique identifier.
079   * This identifier can be referenced by attribute with value of IDREF.
080   * The identifier must begin with letter, followed by any number of
081   * letters, digits, hyphens, underscores, colons and periods.
082   */
083  int ID = 4;
084
085  /**
086   *  The IDREF constant, specifies reference to a valid ID within
087   * the document.
088   */
089  int IDREF = 5;
090
091  /**
092   *  The IDREFS constant, a space separated list of IDREFs
093   */
094  int IDREFS = 6;
095
096  /**
097   * The NAME constant, means the token that
098   * must begin with letter, followed by any number of
099   * letters, digits, hyphens, underscores, colons and periods.
100   */
101  int NAME = 7;
102
103  /**
104   *  The NAMES constant, specifies a space separated of NAMEs.
105   */
106  int NAMES = 8;
107
108  /**
109   * The NMTOKEN constant, specifies the attribute, consisting of
110   * characters that can be either digits or alphabetic characters).
111   */
112  int NMTOKEN = 9;
113
114  /**
115   * The NMTOKENS constant, specifies a list of NMTOKENs.
116   */
117  int NMTOKENS = 10;
118
119  /**
120   *  The NOTATION constant, a previously defined data type.
121   */
122  int NOTATION = 11;
123
124  /**
125   * The NUMBER constant (means that the attribute consists of at least
126   * one decimal digit).
127   */
128  int NUMBER = 12;
129
130  /**
131   *  The NUMBERS constant, specifies a space separated list of NUMBERs.
132   */
133  int NUMBERS = 13;
134
135  /**
136   *  The NUTOKEN constant.
137   */
138  int NUTOKEN = 14;
139
140  /**
141   *  The NUTOKENS constant.
142   */
143  int NUTOKENS = 15;
144
145  /* -------
146     The entity scope constants.
147     As these four constants are combined with the bitwise OR,
148     they are defined in the hexadecimal notation.
149     The reason of setting the two bits at once (for PUBLIC and SYSTEM)
150     is probably historical.                                      ----- */
151
152  /**
153   * The PUBLIC constant, specifies the public entity. The PUBLIC entities
154   * are assumed to be known to many systems so that a full declaration
155   * need not be transmitted. For example,
156   * &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN"&gt;
157   */
158  int PUBLIC = 0xA;
159
160  /**
161   * The SYSTEM constant, specifies the system entitiy. The system entities
162   * are assumed to be known but require the clear identifer
163   * (like the file path), where they can be found in the system.
164   * For example, <code>
165   * &lt;DOCTYPE html SYSTEM "/path/to/file.dtd"&gt; </code>.
166   */
167  int SYSTEM = 0x11;
168
169  /**
170   * The PARAMETER constant, specifies that entity is only valid
171   * inside SGML DTD scope.
172   */
173  int PARAMETER = 0x40000;
174
175  /**
176   * The GENERAL constant, specifies theat the entity is valid in the
177   * whole HTML document scope.
178   */
179  int GENERAL = 0x10000;
180
181  /* ---- The constants, defining if the element attribute is required,
182     fixed or implied.  ---- */
183
184  /**
185   * The attribute modifier #REQUIRED constant, indicates that the
186   * value must be supplied.
187   */
188  int REQUIRED = 2;
189
190  /**
191   * The attribute modifier #FIXED constant, means that the attribute has
192   * the fixed value that cannot be changed.
193   */
194  int FIXED = 1;
195
196  /**
197   * The attribute modifier #IMPLIED constant,
198   * indicating that for this attribute the user agent must provide
199   * the value itself.
200   */
201  int IMPLIED = 5;
202
203  /**
204   * The attribute modifier #CURRENT constant, specifies the value
205   * that at any point in the document is the last value supplied for
206   * that element. A value is required to be supplied for the first
207   * occurrence of an element
208   */
209  int CURRENT = 3;
210
211  /**
212   * The attribute modifier #CONREF constant, specifies the IDREF value of
213   * the reference to content in another location of the document.
214   * The element with this attribute is empty, the content from
215   * that another location must be used instead.
216   */
217  int CONREF = 4;
218
219  /* ----- Constants, defining if the element
220     start and end tags are required. ---- */
221
222  /**
223   *  The STARTTAG, meaning that the element needs a starting tag.
224   */
225  int STARTTAG = 13;
226
227  /**
228   *  The ENDTAG constant, meaning that the element needs a closing tag.
229   */
230  int ENDTAG = 14;
231
232  /* ----- Other constants: ----- */
233
234  /**
235   * The ANY constant, specifies
236   * an attribute, consisting from arbitrary characters.
237   */
238  int ANY = 19;
239
240  /**
241   *  The DEFAULT constant, specifies the default value.
242   */
243  int DEFAULT = 131072;
244
245  /**
246   *  The ENTITIES constant (list of ENTITYes)
247   */
248  int ENTITIES = 3;
249
250  /**
251   *  The ENTITY constant, meaning the numeric or symbolic name of some
252   * HTML data.
253   */
254  int ENTITY = 2;
255
256  /**
257   *  The MD constant.
258   */
259  int MD = 16;
260
261  /**
262   *  The MODEL constant.
263   */
264  int MODEL = 18;
265
266  /**
267   * The MS constant.
268   */
269  int MS = 15;
270
271  /**
272   * The PI (Processing Instruction) constant, specifies a processing
273   * instruction. Processing instructions are used to embed information
274   * intended for specific applications.
275   */
276  int PI = 12;
277
278  /**
279   * The RCDATA constant (Entity References and Character Data), specifies
280   * the content model, consisting of characters AND entities. The
281   * "&lt;" is threated as an ordinary character, but
282   * "<code>&amp;name;</code>" still means the general entity with
283   *  the given name.
284   */
285  int RCDATA = 16;
286
287  /**
288   * The SDATA constant. Means that the value contains the entity name
289   * and the replacement value of a character entity reference.
290   */
291  int SDATA = 11;
292}