org.jdom
Class DocType


public class DocType
implements Cloneable, Serializable

DocType represents an XML DOCTYPE declaration.

Author:
Brett McLaughlin, Jason Hunter
Version: 1.0

Constructor Summary
DocType(String elementName, String publicID, String systemID)
           This will create the DocType with the specified element name and a reference to an external DTD.
DocType(String elementName, String systemID)
           This will create the DocType with the specified element name and reference to an external DTD.
DocType(String elementName)
           This will create the DocType with the specified element name

Method Summary
 Objectclone()
           This will return a clone of this DocType.
 final booleanequals(Object ob)
           This tests for equality of this DocType to the supplied Object.
 StringgetElementName()
           This will retrieve the element name being constrained.
 StringgetPublicID()
           This will retrieve the public ID of an externally referenced DTD, or an empty String if none is referenced.
 final StringgetSerializedForm()
           This will return the DocType in XML format, usable in an XML document.
 StringgetSystemID()
           This will retrieve the system ID of an externally referenced DTD, or an empty String if none is referenced.
 final inthashCode()
           This returns the hash code for this DocType.
 DocTypesetPublicID(String publicID)
           This will set the public ID of an externally referenced DTD.
 DocTypesetSystemID(String systemID)
           This will set the system ID of an externally referenced DTD.
 StringtoString()
           This returns a String representation of the DocType, suitable for debugging.

Constructor Detail

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

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

DocType

public DocType(String elementName)

This will create the DocType with the specified element name

Parameters:
elementName - String name of element being constrained.
Method Detail

clone

public Object clone()

This will return a clone of this DocType.

Returns: Object - clone of this DocType.

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.

getElementName

public String getElementName()

This will retrieve the element name being constrained.

Returns: String - element name for DOCTYPE

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.

getSerializedForm

public final String getSerializedForm()

This will return the DocType in XML format, usable in an XML document.

Returns: String - the serialized form of the DocType.

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.

hashCode

public final int hashCode()

This returns the hash code for this DocType.

Returns: int - hash code.

setPublicID

public DocType setPublicID(String publicID)

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

Returns: publicID String public ID of referenced DTD.

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.

toString

public String toString()

This returns a String representation of the DocType, suitable for debugging. If the XML representation of the DocType is desired, getSerializedForm() should be used.

Returns: String - information about the DocType

Association Links

to Class java.lang.String

The element being constrained

to Class java.lang.String

The public ID of the DOCTYPE

to Class java.lang.String

The system ID of the DOCTYPE