/* DTD.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.swing.text.html.parser;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.BitSet;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector;
/**
*
Representation or the SGML DTD document.
* Provides basis for describing a syntax of the
* HTML documents. The fields of this class are NOT initialized in
* constructor. You need to do this separately before passing this data
* structure to the HTML parser. The subclasses with the fields, pre-
* initialized, for example, for HTML 4.01, can be available only between
* the implementation specific classes
* ( for example, {@link gnu.javax.swing.text.html.parser.HTML_401F }
* in this implementation).
*
* If you need more information about SGML DTD documents,
* the author suggests to read SGML tutorial on
* http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html.
* We also recommend Goldfarb C.F (1991) The SGML Handbook,
* Oxford University Press, 688 p, ISBN: 0198537379.
*
*
* Warning: the html, head and other tag fields will only be automatically
* assigned if the VM has the correctly implemented reflection mechanism.
* As these fields are not used anywhere in the implementation, not
* exception will be thrown in the opposite case.
*
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public class DTD
implements DTDConstants
{
/**
* The version of the persistent data format.
* @specnote This was made final in 1.5.
*/
public static final int FILE_VERSION = 1;
/**
* The table of existing available DTDs.
*/
static Hashtable dtdHash = new Hashtable();
/**
* The applet element for this DTD.
*/
public Element applet;
/**
* The base element for this DTD.
*/
public Element base;
/**
* The body element for this DTD.
*/
public Element body;
/**
* The head element for this DTD.
*/
public Element head;
/**
* The html element for this DTD.
*/
public Element html;
/**
* The isindex element of for this DTD.
*/
public Element isindex;
/**
* The meta element for this DTD.
*/
public Element meta;
/**
* The p element for this DTD.
*/
public Element p;
/**
* The param element for this DTD.
*/
public Element param;
/**
* The pcdata for this DTD.
*/
public Element pcdata;
/**
* The title element for this DTD.
*/
public Element title;
/**
* The element for accessing all DTD elements by name.
*/
public Hashtable elementHash =
new Hashtable();
/**
* The entity table for accessing all DTD entities by name.
*/
public Hashtable