public class DTD extends Objectimplements DTDConstants
Element,
AttributeList,
ContentModel,
Parser
| Modifier and Type | Field and Description |
|---|---|
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
|
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| Modifier | Constructor and Description |
|---|---|
protected |
DTD(String
Creates a new DTD with the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
protected AttributeList |
defAttributeList(String
Creates and returns an
AttributeList.
|
protected ContentModel |
defContentModel(int type, Object
Creates and returns a new content model.
|
protected Element |
defElement(String
Creates and returns an
Element.
|
Entity |
defEntity(String
Creates and returns a character
Entity.
|
protected Entity |
defEntity(String
Creates and returns an
Entity.
|
void |
defineAttributes(String
Defines attributes for an
Element.
|
Element |
defineElement(String
Returns the
Element which matches the specified parameters.
|
Entity |
defineEntity(String
Defines an entity.
|
static DTD |
getDTD(String
Returns a DTD with the specified
name.
|
Element |
getElement(int index)
Gets an element by index.
|
Element |
getElement(String
Gets an element by name.
|
Entity |
getEntity(int ch)
Gets a character entity.
|
Entity |
getEntity(String
Gets an entity by name.
|
String |
getName()
Gets the name of the DTD.
|
static void |
putDTDHash(String
|
void |
read(DataInputStream
Recreates a DTD from an archived format.
|
String |
toString()
Returns a string representation of this DTD.
|
public Stringname
public final Elementpcdata
public final Elementhtml
public final Elementmeta
public final Elementbase
public final Elementisindex
public final Elementhead
public final Elementbody
public final Elementapplet
public final Elementparam
public final Elementp
public final Elementtitle
public static final int FILE_VERSION
protected DTD(Stringname)
name - the name, as a
String of the new DTD
public StringgetName()
public EntitygetEntity(String name)
Entity corresponding to the
name
String
public EntitygetEntity(int ch)
Entity corresponding to the
ch character
public ElementgetElement(String name)
name - the requested
String
Element corresponding to
name, which may be newly created
public ElementgetElement(int index)
index - the requested index
Element corresponding to
index
public EntitydefineEntity(String name, int type, char[] data)
Entity specified by
name,
type, and
data exists, it is returned; otherwise a new
Entity is created and is returned.
name - the name of the
Entity as a
String
type - the type of the
Entity
data - the
Entity's data
Entity requested or a new
Entity if not found
public ElementdefineElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, BitSet exclusions, BitSet inclusions, AttributeList atts)
Element which matches the specified parameters. If one doesn't exist, a new one is created and returned.
name - the name of the
Element
type - the type of the
Element
omitStart -
true if start should be omitted
omitEnd -
true if end should be omitted
content - the
ContentModel
atts - the
AttributeList specifying the
Element
Element specified
public void defineAttributes(Stringname, AttributeList atts)
Element.
name - the name of the
Element
atts - the
AttributeList specifying the
Element
public EntitydefEntity(String name, int type, int ch)
Entity.
name - the entity's name
Entity
protected EntitydefEntity(String name, int type, String str)
Entity.
name - the entity's name
Entity
protected ElementdefElement(String name, int type, boolean omitStart, boolean omitEnd, ContentModel content, String [] exclusions, String [] inclusions, AttributeList atts)
Element.
name - the element's name
Element
protected AttributeListdefAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts)
AttributeList.
name - the attribute list's name
AttributeList
protected ContentModeldefContentModel(int type, Object obj, ContentModel next)
type - the type of the new content model
ContentModel
public StringtoString()
public static DTDgetDTD(String name) throws IOException
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.
name - the name of the DTD
name
IOException
public void read(DataInputStreamin) throws IOException
in - the
DataInputStream to read from
IOException