All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.tudarmstadt.ito.schemas.dtd.DTD

java.lang.Object
   |
   +----de.tudarmstadt.ito.schemas.dtd.DTD

public class DTD
extends Object
Class representing a DTD.

Version:
1.01
Author:
Ronald Bourret, Technical University of Darmstadt

Variable Index

 o elementTypes
A Hashtable of ElementTypes defined in the DTD, keyed by the qualified element type name (ElementType.name.qualified).
 o notations
A Hashtable of Notations defined in the DTD, keyed by the notation name.
 o parameterEntities
A Hashtable of ParameterEntities defined in the DTD, keyed by the entity name.
 o parsedGeneralEntities
A Hashtable of ParsedGeneralEntities defined in the DTD, keyed by the entity name.
 o unparsedEntities
A Hashtable of UnparsedEntities defined in the DTD, keyed by the entity name.

Constructor Index

 o DTD()
Construct a new DTD.

Method Index

 o addElementType(NSName)
Add a new ElementType.
 o addElementType(String, String, String)
Same as addElementType(NSName) except that the local name, prefix, and namespace URI are specified.
 o checkElementTypeReferences()
Checks that all element types referred to in the content models of ElementTypes have been added to the DTD through addElementType.
 o checkNotationReferences()
Checks that all notations referred to Attributes have been defined.
 o elementTypeDefined(NSName)
Checks if an element type has been defined -- that is, added with addElementType.
 o getElementType(NSName)
Get an ElementType.
 o getElementType(String, String, String)
Same as getElementType(NSName) except that the local name, prefix, and namespace URI are specified.
 o serialize(OutputStream, boolean)
Serialize a DTD to an OutputStream.
 o updateANYParents()
For element types with a content model of ANY, constructs the parent and children Hashtables in the ElementType objects in the DTD.

Variables

 o elementTypes
 public Hashtable elementTypes
A Hashtable of ElementTypes defined in the DTD, keyed by the qualified element type name (ElementType.name.qualified).

 o notations
 public Hashtable notations
A Hashtable of Notations defined in the DTD, keyed by the notation name.

 o parsedGeneralEntities
 public Hashtable parsedGeneralEntities
A Hashtable of ParsedGeneralEntities defined in the DTD, keyed by the entity name.

 o parameterEntities
 public Hashtable parameterEntities
A Hashtable of ParameterEntities defined in the DTD, keyed by the entity name.

 o unparsedEntities
 public Hashtable unparsedEntities
A Hashtable of UnparsedEntities defined in the DTD, keyed by the entity name.

Constructors

 o DTD
 public DTD()
Construct a new DTD.

Methods

 o addElementType
 public ElementType addElementType(NSName name) throws DTDException
Add a new ElementType. This method checks that the element type has not been added before.

Parameters:
name - The NSName of the element type.
Throws: DTDException
Thrown if addElementType has already been called for the element type.
 o getElementType
 public ElementType getElementType(NSName name)
Get an ElementType. If the ElementType does not exist, a new ElementType is created. Note that addElementType can still be called for ElementTypes created in this manner.

Parameters:
name - The NSName of the element type.
 o addElementType
 public ElementType addElementType(String local,
                                   String prefix,
                                   String uri) throws DTDException
Same as addElementType(NSName) except that the local name, prefix, and namespace URI are specified.

Parameters:
local - The local name of the element type.
prefix - The namespace prefix. May be null.
uri - The namespace URI. May be null.
Throws: DTDException
Thrown if addElementType has already been called for the element type.
 o getElementType
 public ElementType getElementType(String local,
                                   String prefix,
                                   String uri)
Same as getElementType(NSName) except that the local name, prefix, and namespace URI are specified.

Parameters:
local - The local name of the element type.
prefix - The namespace prefix. May be null.
uri - The namespace URI. May be null.
 o updateANYParents
 public void updateANYParents()
For element types with a content model of ANY, constructs the parent and children Hashtables in the ElementType objects in the DTD. Note that operation cannot successfully be performed until after all ElementTypes have been added to the DTD.

 o checkElementTypeReferences
 public void checkElementTypeReferences() throws DTDException
Checks that all element types referred to in the content models of ElementTypes have been added to the DTD through addElementType.

Throws: DTDException
Thrown if an element type has been referred to but not added.
 o checkNotationReferences
 public void checkNotationReferences() throws DTDException
Checks that all notations referred to Attributes have been defined.

Throws: DTDException
Thrown if notation has been referred to but not defined.
 o elementTypeDefined
 public boolean elementTypeDefined(NSName name)
Checks if an element type has been defined -- that is, added with addElementType.

Parameters:
name - The NSName of the element type.
 o serialize
 public void serialize(OutputStream out,
                       boolean pretty) throws IOException
Serialize a DTD to an OutputStream.

Parameters:
out - The OutputStream.
pretty - Whether to pretty-print the DTD.

All Packages  Class Hierarchy  This Package  Previous  Next  Index