All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.jdom.DocType

java.lang.Object
   |
   +----org.jdom.DocType

public class DocType
extends Object
implements Serializable, Cloneable

DocType represents an XML DOCTYPE declaration.

Version:
$Revision: 1.18 $, $Date: 2002/02/05 08:03:18 $
Author:
Brett McLaughlin, Jason Hunter

Variable Index

 o document
The document having this DOCTYPE
 o elementName
The element being constrained
 o internalSubset
The internal subset of the DOCTYPE
 o publicID
The public ID of the DOCTYPE
 o systemID
The system ID of the DOCTYPE

Constructor Index

 o DocType()

Default, no-args constructor for implementations to use if needed.

 o DocType(String)

This will create the DocType with the specified element name

 o DocType(String, String)

This will create the DocType with the specified element name and reference to an external DTD.

 o DocType(String, String, String)

This will create the DocType with the specified element name and a reference to an external DTD.

Method Index

 o clone()

This will return a clone of this DocType.

 o equals(Object)

This tests for equality of this DocType to the supplied Object.

 o getDocument()

This retrieves the owning {

 o getElementName()

This will retrieve the element name being constrained.

 o getInternalSubset()

This returns the data for the internal subset

 o getPublicID()

This will retrieve the public ID of an externally referenced DTD, or an empty String if none is referenced.

 o getSystemID()

This will retrieve the system ID of an externally referenced DTD, or an empty String if none is referenced.

 o hashCode()

This returns the hash code for this DocType.

 o setDocument(Document)

This sets the {

 o setElementName(String)

This will set the root element name declared by this DOCTYPE declaration.

 o setInternalSubset(String)

This sets the data for the internal subset.

 o setPublicID(String)

This will set the public ID of an externally referenced DTD.

 o setSystemID(String)

This will set the system ID of an externally referenced DTD.

 o toString()

This returns a String representation of the DocType, suitable for debugging.

Variables

 o elementName
 protected String elementName
The element being constrained

 o publicID
 protected String publicID
The public ID of the DOCTYPE

 o systemID
 protected String systemID
The system ID of the DOCTYPE

 o document
 protected Document document
The document having this DOCTYPE

 o internalSubset
 protected String internalSubset
The internal subset of the DOCTYPE

Constructors

 o DocType
 protected DocType()

Default, no-args constructor for implementations to use if needed.

 o DocType
 public DocType(String elementName,
                String publicID,
                String systemID)

This will create the DocType with the specified element name and a reference to an external DTD.

Parameters:
elementName - String name of element being constrained.
publicID - String public ID of referenced DTD
systemID - String system ID of referenced DTD
Throws: IllegalDataException
if the given system ID is not a legal system literal or the public ID is not a legal public ID.
Throws: IllegalNameException
if the given root element name is not a legal XML element name.
 o DocType
 public DocType(String elementName,
                String systemID)

This will create the DocType with the specified element name and reference to an external DTD.

Parameters:
elementName - String name of element being constrained.
systemID - String system ID of referenced DTD
Throws: IllegalDataException
if the given system ID is not a legal system literal.
Throws: IllegalNameException
if the given root element name is not a legal XML element name.
 o DocType
 public DocType(String elementName)

This will create the DocType with the specified element name

Parameters:
elementName - String name of element being constrained.
Throws: IllegalNameException
if the given root element name is not a legal XML element name.

Methods

 o getElementName
 public String getElementName()

This will retrieve the element name being constrained.

Returns:
String - element name for DOCTYPE
 o setElementName
 public DocType setElementName(String elementName)

This will set the root element name declared by this DOCTYPE declaration.

Parameters:
elementName - String name of root element being constrained.
Returns:
DocType DocType this DocType object
Throws: IllegalNameException
if the given root element name is not a legal XML element name.
 o getPublicID
 public String getPublicID()

This will retrieve the public ID of an externally referenced DTD, or an empty String if none is referenced.

Returns:
String - public ID of referenced DTD.
 o setPublicID
 public DocType setPublicID(String publicID)

This will set the public ID of an externally referenced DTD.

Returns:
DocType DocType this DocType object
Throws: IllegalDataException
if the given public ID is not a legal public ID.
 o getSystemID
 public String getSystemID()

This will retrieve the system ID of an externally referenced DTD, or an empty String if none is referenced.

Returns:
String - system ID of referenced DTD.
 o setSystemID
 public DocType setSystemID(String systemID)

This will set the system ID of an externally referenced DTD.

Returns:
systemID String system ID of referenced DTD.
Throws: IllegalDataException
if the given system ID is not a legal system literal.
 o getDocument
 public Document getDocument()

This retrieves the owning {@link Document} for this DocType, or null if not a currently a member of a {@link Document}.

Returns:
Document owning this DocType, or null.
 o setDocument
 protected DocType setDocument(Document document)

This sets the {@link Document} holding this doctype.

Parameters:
DocType - Document holding this doctype
Returns:
Document this DocType modified
 o setInternalSubset
 public void setInternalSubset(String newData)

This sets the data for the internal subset.

Parameters:
newData - data for the internal subset, as a String.
 o getInternalSubset
 public String getInternalSubset()

This returns the data for the internal subset

Returns:
String - the internal subset
 o toString
 public String toString()

This returns a String representation of the DocType, suitable for debugging.

Returns:
String - information about the DocType
Overrides:
toString in class Object
 o equals
 public final boolean equals(Object ob)

This tests for equality of this DocType to the supplied Object.

Parameters:
ob - Object to compare to.
Returns:
boolean - whether the DocType is equal to the supplied Object.
Overrides:
equals in class Object
 o hashCode
 public final int hashCode()

This returns the hash code for this DocType.

Returns:
int - hash code.
Overrides:
hashCode in class Object
 o clone
 public Object clone()

This will return a clone of this DocType.

Returns:
Object - clone of this DocType.
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index