Top Description Fields Constructors Methods
org.jdom

public Class DocType

extends Content
Class Inheritance

An XML DOCTYPE declaration. Method allow the user to get and set the root element name, public id, and system id.
Authors
Brett McLaughlin, Jason Hunter
Version
$Revision: 1.32 $, $Date: 2007/11/10 05:28:58 $

Field Summary

Modifier and TypeField and Description
private static final String
protected String
elementName

The element being constrained

protected String
internalSubset

The internal subset of the DOCTYPE

protected String
publicID

The public ID of the DOCTYPE

protected String
systemID

The system ID of the DOCTYPE

Inherited from org.jdom.Content:
parent

Constructor Summary

AccessConstructor and Description
protected
DocType()

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

public
DocType(String
String name of element being constrained.
elementName
,
String
String public ID of referenced DTD
publicID
,
String
String system ID of referenced DTD
systemID
)

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

public
DocType(String
String name of element being constrained.
elementName
,
String
String system ID of referenced DTD
systemID
)

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

public
DocType(String
String name of element being constrained.
elementName
)

This will create the DocType with the specified element name

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

String - element name for DOCTYPE
getElementName
()

This will retrieve the element name being constrained.

public String

Returns:

String - the internal subset
getInternalSubset
()

This returns the data for the internal subset.

public String

Returns:

String - public ID of referenced DTD.
getPublicID
()

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

public String

Returns:

String - system ID of referenced DTD.
getSystemID
()

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

public String

Returns:

the empty string
getValue
()

Implements abstract org.jdom.Content.getValue.

Returns the empty string since doctypes don't have an XPath 1.0 string value.
public DocType

Returns:

DocType DocType this DocType object
setElementName
(String
String name of root element being constrained.
elementName
)

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

public void
setInternalSubset(String
data for the internal subset, as a String.
newData
)

This sets the data for the internal subset.

public DocType

Returns:

DocType DocType this DocType object
setPublicID
(String
id to set
publicID
)

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

public DocType

Returns:

systemID String system ID of referenced DTD.
setSystemID
(String
id to set
systemID
)

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

public String

Returns:

String - information about the DocType
toString
()

Overrides java.lang.Object.toString.

This returns a String representation of the DocType, suitable for debugging.
Inherited from org.jdom.Content:
clonedetachequalsgetDocumentgetParentgetParentElementhashCodesetParent

Field Detail

CVS_IDback to summary
private static final String CVS_ID
elementNameback to summary
protected String elementName

The element being constrained

internalSubsetback to summary
protected String internalSubset

The internal subset of the DOCTYPE

publicIDback to summary
protected String publicID

The public ID of the DOCTYPE

systemIDback to summary
protected String systemID

The system ID of the DOCTYPE

Constructor Detail

DocTypeback to summary
protected DocType()

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

DocTypeback to summary
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

String name of element being constrained.

publicID:String

String public ID of referenced DTD

systemID:String

String system ID of referenced DTD

Exceptions
IllegalDataException:
if the given system ID is not a legal system literal or the public ID is not a legal public ID.
IllegalNameException:
if the given root element name is not a legal XML element name.
DocTypeback to summary
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

String name of element being constrained.

systemID:String

String system ID of referenced DTD

Exceptions
IllegalDataException:
if the given system ID is not a legal system literal.
IllegalNameException:
if the given root element name is not a legal XML element name.
DocTypeback to summary
public DocType(String elementName)

This will create the DocType with the specified element name

Parameters
elementName:String

String name of element being constrained.

Exceptions
IllegalNameException:
if the given root element name is not a legal XML element name.

Method Detail

getElementNameback to summary
public String getElementName()

This will retrieve the element name being constrained.

Returns:String

String - element name for DOCTYPE

getInternalSubsetback to summary
public String getInternalSubset()

This returns the data for the internal subset.

Returns:String

String - the internal subset

getPublicIDback to summary
public String getPublicID()

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

Returns:String

String - public ID of referenced DTD.

getSystemIDback to summary
public String getSystemID()

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

Returns:String

String - system ID of referenced DTD.

getValueback to summary
public String getValue()

Implements abstract org.jdom.Content.getValue.

Returns the empty string since doctypes don't have an XPath 1.0 string value.

Returns:String

the empty string

setElementNameback to summary
public DocType setElementName(String elementName)

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

Parameters
elementName:String

String name of root element being constrained.

Returns:DocType

DocType DocType this DocType object

Exceptions
IllegalNameException:
if the given root element name is not a legal XML element name.
setInternalSubsetback to summary
public void setInternalSubset(String newData)

This sets the data for the internal subset.

Parameters
newData:String

data for the internal subset, as a String.

setPublicIDback to summary
public DocType setPublicID(String publicID)

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

Parameters
publicID:String

id to set

Returns:DocType

DocType DocType this DocType object

Exceptions
IllegalDataException:
if the given public ID is not a legal public ID.
setSystemIDback to summary
public DocType setSystemID(String systemID)

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

Parameters
systemID:String

id to set

Returns:DocType

systemID String system ID of referenced DTD.

Exceptions
IllegalDataException:
if the given system ID is not a legal system literal.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

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

Returns:String

String - information about the DocType