JavaTM 2 Platform
Std. Ed. v1.3.1

javax.swing.text.html.parser
Class DTD

java.lang.Object
  |
  +--javax.swing.text.html.parser.DTD
All Implemented Interfaces:
DTDConstants

public class DTD
extends Object
implements DTDConstants

The representation of an SGML DTD. This is produced by the DTDParser. The resulting DTD object describes a document syntax and is needed to parser HTML documents using the Parser. It contains a list of elements and their attributes as well as a list of entities defined in the DTD.

See Also:
Element, AttributeList, ContentModel, DTDParser, Parser

Field Summary
 Element applet
           
 Element base
           
 Element body
           
 Hashtable elementHash
           
 Vector elements
           
 Hashtable entityHash
           
static int FILE_VERSION
           
 Element head
           
 Element html
           
 Element isindex
           
 Element meta
           
 String name
           
 Element p
           
 Element param
           
 Element pcdata
           
 Element title
           
 
Fields inherited from interface javax.swing.text.html.parser.DTDConstants
ANY, CDATA, CONREF, CURRENT, DEFAULT, EMPTY, ENDTAG, ENTITIES, ENTITY, FIXED, GENERAL, ID, IDREF, IDREFS, IMPLIED, MD, MODEL, MS, NAME, NAMES, NMTOKEN, NMTOKENS, NOTATION, NUMBER, NUMBERS, NUTOKEN, NUTOKENS, PARAMETER, PI, PUBLIC, RCDATA, REQUIRED, SDATA, STARTTAG, SYSTEM
 
Constructor Summary
protected DTD(String name)
          Create a new DTD.
 
Method Summary
protected  AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts)
          Define an attribute list
protected  ContentModel defContentModel(int type, Object obj, ContentModel next)
          Define a content model
protected  Element defElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, String[] exclusions, String[] inclusions, AttributeList atts)
          Define an element.
 Entity defEntity(String name, int type, int ch)
          Define a character entity.
protected  Entity defEntity(String name, int type, String str)
          Define an entity.
 void defineAttributes(String name, AttributeList atts)
          Define the attributes of an element.
 Element defineElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, BitSet exclusions, BitSet inclusions, AttributeList atts)
          Define an element.
 Entity defineEntity(String name, int type, char[] data)
          Define an entity.
static DTD getDTD(String name)
          Get a DTD.
 Element getElement(int index)
          Get an element by index.
 Element getElement(String name)
          Get an element by name.
 Entity getEntity(int ch)
          Get a character entity.
 Entity getEntity(String name)
          Get an entity by name.
 String getName()
          Get the name of the DTD.
static void putDTDHash(String name, DTD dtd)
           
 void read(DataInputStream in)
           
 String toString()
          Return a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name

elements

public Vector elements

elementHash

public Hashtable elementHash

entityHash

public Hashtable entityHash

pcdata

public final Element pcdata

html

public final Element html

meta

public final Element meta

base

public final Element base

isindex

public final Element isindex

head

public final Element head

body

public final Element body

applet

public final Element applet

param

public final Element param

p

public final Element p

title

public final Element title

FILE_VERSION

public static int FILE_VERSION
Constructor Detail

DTD

protected DTD(String name)
Create a new DTD.
Method Detail

getName

public String getName()
Get the name of the DTD.

getEntity

public Entity getEntity(String name)
Get an entity by name.

getEntity

public Entity getEntity(int ch)
Get a character entity.

getElement

public Element getElement(String name)
Get an element by name. A new element is created if the element doesn't exist.

getElement

public Element getElement(int index)
Get an element by index.

defineEntity

public Entity defineEntity(String name,
                           int type,
                           char[] data)
Define an entity.

defineElement

public Element defineElement(String name,
                             int type,
                             boolean omitStart,
                             boolean omitEnd,
                             ContentModel content,
                             BitSet exclusions,
                             BitSet inclusions,
                             AttributeList atts)
Define an element.

defineAttributes

public void defineAttributes(String name,
                             AttributeList atts)
Define the attributes of an element.

defEntity

public Entity defEntity(String name,
                        int type,
                        int ch)
Define a character entity.

defEntity

protected Entity defEntity(String name,
                           int type,
                           String str)
Define an entity.

defElement

protected Element defElement(String name,
                             int type,
                             boolean omitStart,
                             boolean omitEnd,
                             ContentModel content,
                             String[] exclusions,
                             String[] inclusions,
                             AttributeList atts)
Define an element.

defAttributeList

protected AttributeList defAttributeList(String name,
                                         int type,
                                         int modifier,
                                         String value,
                                         String values,
                                         AttributeList atts)
Define an attribute list

defContentModel

protected ContentModel defContentModel(int type,
                                       Object obj,
                                       ContentModel next)
Define a content model

toString

public String toString()
Return a string representation.
Overrides:
toString in class Object
Following copied from class: java.lang.Object
Returns:
a string representation of the object.

putDTDHash

public static void putDTDHash(String name,
                              DTD dtd)

getDTD

public static DTD getDTD(String name)
                  throws IOException
Get a DTD.

read

public void read(DataInputStream in)
          throws IOException

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.