/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* The representation of an SGML DTD. DTD describes a document
* syntax and is used in parsing of HTML documents. It contains
* a list of elements and their attributes as well as a list of
* entities defined in the DTD.
*
* @see Element
* @see AttributeList
* @see ContentModel
* @see Parser
* @author Arthur van Hoff
*/
public
/**
* Creates a new DTD with the specified name.
* @param name the name, as a <code>String</code> of the new DTD
*/
}
/**
* Gets the name of the DTD.
* @return the name of the DTD
*/
return name;
}
/**
* Gets an entity by name.
* @return the <code>Entity</code> corresponding to the
* <code>name</code> <code>String</code>
*/
}
/**
* Gets a character entity.
* @return the <code>Entity</code> corresponding to the
* <code>ch</code> character
*/
}
/**
* Returns <code>true</code> if the element is part of the DTD,
* otherwise returns <code>false</code>.
*
* @param name the requested <code>String</code>
* @return <code>true</code> if <code>name</code> exists as
* part of the DTD, otherwise returns <code>false</code>
*/
}
/**
* Gets an element by name. A new element is
* created if the element doesn't exist.
*
* @param name the requested <code>String</code>
* @return the <code>Element</code> corresponding to
* <code>name</code>, which may be newly created
*/
if (e == null) {
elements.addElement(e);
}
return e;
}
/**
* Gets an element by index.
*
* @param index the requested index
* @return the <code>Element</code> corresponding to
* <code>index</code>
*/
}
/**
* Defines an entity. If the <code>Entity</code> specified
* by <code>name</code>, <code>type</code>, and <code>data</code>
* exists, it is returned; otherwise a new <code>Entity</code>
* is created and is returned.
*
* @param name the name of the <code>Entity</code> as a <code>String</code>
* @param type the type of the <code>Entity</code>
* @param data the <code>Entity</code>'s data
* @return the <code>Entity</code> requested or a new <code>Entity</code>
* if not found
*/
case CDATA:
case SDATA:
break;
}
}
}
return ent;
}
/**
* Returns the <code>Element</code> which matches the
* specified parameters. If one doesn't exist, a new
* one is created and returned.
*
* @param name the name of the <code>Element</code>
* @param type the type of the <code>Element</code>
* @param omitStart <code>true</code> if start should be omitted
* @param omitEnd <code>true</code> if end should be omitted
* @param content the <code>ContentModel</code>
* @param atts the <code>AttributeList</code> specifying the
* <code>Element</code>
* @return the <code>Element</code> specified
*/
e.exclusions = exclusions;
e.inclusions = inclusions;
return e;
}
/**
* Defines attributes for an {@code Element}.
*
* @param name the name of the <code>Element</code>
* @param atts the <code>AttributeList</code> specifying the
* <code>Element</code>
*/
}
/**
* Creates and returns a character <code>Entity</code>.
* @param name the entity's name
* @return the new character <code>Entity</code>
*/
}
/**
* Creates and returns an <code>Entity</code>.
* @param name the entity's name
* @return the new <code>Entity</code>
*/
}
/**
* Creates and returns an <code>Element</code>.
* @param name the element's name
* @return the new <code>Element</code>
*/
}
}
}
}
}
}
}
/**
* Creates and returns an <code>AttributeList</code>.
* @param name the attribute list's name
* @return the new <code>AttributeList</code>
*/
protected AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts) {
}
}
}
}
/**
* Creates and returns a new content model.
* @param type the type of the new content model
* @return the new <code>ContentModel</code>
*/
}
/**
* Returns a string representation of this DTD.
* @return the string representation of this DTD
*/
return name;
}
/**
* The hashtable key of DTDs in AppContext.
*/
}
/**
* Returns a DTD with the specified <code>name</code>. If
* a DTD with that name doesn't exist, one is created
* and returned. Any uppercase characters in the name
* are converted to lowercase.
*
* @param name the name of the DTD
* @return the DTD which corresponds to <code>name</code>
*/
return dtd;
}
}
return result;
}
/**
* Recreates a DTD from an archived format.
* @param in the <code>DataInputStream</code> to read from
*/
}
//
// Read the list of names
//
}
//
// Read the entities
//
for (int i = 0; i < num; i++) {
}
// Read the elements
//
for (int i = 0; i < num; i++) {
}
}
throws IOException {
switch(flag) {
case 0: // null
return null;
case 1: { // content_c
}
case 2: { // content_e
}
default:
throw new IOException("bad bdtd");
}
}
throws IOException {
if (num == 0) {
return null;
}
for (int i = 0; i < num; i++) {
}
return result;
}
throws IOException {
if (numValues > 0) {
for (int i = 0; i < numValues; i++) {
}
}
// We reverse the order of the linked list by doing this, but
// that order isn't important.
}
return result;
}
}