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

Untamed:


Field Summary
 Element applet
          Enabled:
 Element base
          Enabled:
 Element body
          Enabled:
(package private) static Hashtable dtdHash
          The hashtable of DTDs.
 Hashtable elementHash
          Enabled:
 Vector elements
          Enabled:
 Hashtable entityHash
          Enabled:
static int FILE_VERSION
          Enabled:
 Element head
          Enabled:
 Element html
          Enabled:
 Element isindex
          Enabled:
(package private)  Element link
           
 Element meta
          Enabled:
 String name
          Enabled:
 Element p
          Enabled:
 Element param
          Enabled:
 Element pcdata
          Enabled:
(package private)  Element style
           
 Element title
          Enabled:
 
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)
          Creates a new DTD with the specified name.
 
Method Summary
protected  AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts)
          Creates and returns an AttributeList.
protected  ContentModel defContentModel(int type, Object obj, ContentModel next)
          Creates and returns a new content model.
protected  Element defElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, String[] exclusions, String[] inclusions, AttributeList atts)
          Creates and returns an Element.
 Entity defEntity(String name, int type, int ch)
          Enabled: Creates and returns a character Entity.
protected  Entity defEntity(String name, int type, String str)
          Creates and returns an Entity.
 void defineAttributes(String name, AttributeList atts)
          Enabled: Returns the Element which matches the specified AttributeList.
 Element defineElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, BitSet exclusions, BitSet inclusions, AttributeList atts)
          Enabled: Returns the Element which matches the specified parameters.
 Entity defineEntity(String name, int type, char[] data)
          Enabled: Defines an entity.
(package private)  boolean elementExists(String name)
          Returns true if the element is part of the DTD, otherwise returns false.
static DTD getDTD(String name)
          Enabled: Returns a DTD with the specified name.
 Element getElement(int index)
          Enabled: Gets an element by index.
 Element getElement(String name)
          Enabled: Gets an element by name.
 Entity getEntity(int ch)
          Enabled: Gets a character entity.
 Entity getEntity(String name)
          Enabled: Gets an entity by name.
 String getName()
          Enabled: Gets the name of the DTD.
static void putDTDHash(String name, DTD dtd)
          Enabled:
 void read(DataInputStream in)
          Enabled: Recreates a DTD from an archived format.
private  AttributeList readAttributeList(DataInputStream in, String[] names)
           
private  ContentModel readContentModel(DataInputStream in, String[] names)
           
private  String[] readNameArray(DataInputStream in, String[] names)
           
 String toString()
          Suppressed: Returns a string representation of this DTD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name
Enabled:


elements

public Vector elements
Enabled:


elementHash

public Hashtable elementHash
Enabled:


entityHash

public Hashtable entityHash
Enabled:


pcdata

public final Element pcdata
Enabled:


html

public final Element html
Enabled:


meta

public final Element meta
Enabled:


base

public final Element base
Enabled:


isindex

public final Element isindex
Enabled:


head

public final Element head
Enabled:


body

public final Element body
Enabled:


applet

public final Element applet
Enabled:


param

public final Element param
Enabled:


p

public final Element p
Enabled:


title

public final Element title
Enabled:


style

final Element style

link

final Element link

FILE_VERSION

public static int FILE_VERSION
Enabled:


dtdHash

static Hashtable dtdHash
The hashtable of DTDs.

Constructor Detail

DTD

protected DTD(String name)
Creates a new DTD with the specified name.

Parameters:
name - the name, as a String of the new DTD
Method Detail

getName

public String getName()
Enabled: Gets the name of the DTD.

Returns:
the name of the DTD

getEntity

public Entity getEntity(String name)
Enabled: Gets an entity by name.

Returns:
the Entity corresponding to the name String

getEntity

public Entity getEntity(int ch)
Enabled: Gets a character entity.

Returns:
the Entity corresponding to the ch character

elementExists

boolean elementExists(String name)
Returns true if the element is part of the DTD, otherwise returns false.

Parameters:
name - the requested String
Returns:
true if name exists as part of the DTD, otherwise returns false

getElement

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

Parameters:
name - the requested String
Returns:
the Element corresponding to name, which may be newly created

getElement

public Element getElement(int index)
Enabled: Gets an element by index.

Parameters:
index - the requested index
Returns:
the Element corresponding to index

defineEntity

public Entity defineEntity(String name,
                           int type,
                           char[] data)
Enabled: Defines an entity. If the Entity specified by name, type, and data exists, it is returned; otherwise a new Entity is created and is returned.

Parameters:
name - the name of the Entity as a String
type - the type of the Entity
data - the Entity's data
Returns:
the Entity requested or a new Entity if not found

defineElement

public Element defineElement(String name,
                             int type,
                             boolean omitStart,
                             boolean omitEnd,
                             ContentModel content,
                             BitSet exclusions,
                             BitSet inclusions,
                             AttributeList atts)
Enabled: Returns the Element which matches the specified parameters. If one doesn't exist, a new one is created and returned.

Parameters:
name - the name of the Element
type - the type of the Element
omitStart - trueomitEnd - true if end should be omitted
content - the ContentModel
atts - the AttributeList specifying the Element
Returns:
the Element specified

defineAttributes

public void defineAttributes(String name,
                             AttributeList atts)
Enabled: Returns the Element which matches the specified AttributeList. If one doesn't exist, a new one is created and returned.

Parameters:
name - the name of the Element
atts - the AttributeList specifying the Element
Returns:
the Element specified

defEntity

public Entity defEntity(String name,
                        int type,
                        int ch)
Enabled: Creates and returns a character Entity.

Parameters:
name - the entity's name
Returns:
the new character Entity

defEntity

protected Entity defEntity(String name,
                           int type,
                           String str)
Creates and returns an Entity.

Parameters:
name - the entity's name
Returns:
the new Entity

defElement

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

Returns:
the new Element

defAttributeList

protected AttributeList defAttributeList(String name,
                                         int type,
                                         int modifier,
                                         String value,
                                         String values,
                                         AttributeList atts)
Creates and returns an AttributeList.

Parameters:
name - the attribute list's name
Returns:
the new AttributeList

defContentModel

protected ContentModel defContentModel(int type,
                                       Object obj,
                                       ContentModel next)
Creates and returns a new content model.

Parameters:
type - the type of the new content model
Returns:
the new ContentModel

toString

public String toString()
Suppressed: Returns a string representation of this DTD.

Overrides:
toString in class Object
Returns:
the string representation of this DTD

putDTDHash

public static void putDTDHash(String name,
                              DTD dtd)
Enabled:


getDTD

public static DTD getDTD(String name)
                  throws IOException
Enabled: Returns a DTD with the specified name. If a DTD with that name doesn't exist, one is created and returned. Any uppercase characters in the name are converted to lowercase.

Returns:
the DTD which corresponds to name
IOException

read

public void read(DataInputStream in)
          throws IOException
Enabled: Recreates a DTD from an archived format.

Parameters:
in - the DataInputStream to read from
IOException

readContentModel

private ContentModel readContentModel(DataInputStream in,
                                      String[] names)
                               throws IOException
IOException

readNameArray

private String[] readNameArray(DataInputStream in,
                               String[] names)
                        throws IOException
IOException

readAttributeList

private AttributeList readAttributeList(DataInputStream in,
                                        String[] names)
                                 throws IOException
IOException


comments?