Package org.jdom
Class DocType
java.lang.Object
org.jdom.Content
org.jdom.DocType
- All Implemented Interfaces:
Serializable
,Cloneable
An XML DOCTYPE declaration. Method allow the user to get and set the
root element name, public id, and system id.
- Version:
- $Revision: 1.32 $, $Date: 2007/11/10 05:28:58 $
- Author:
- Brett McLaughlin, Jason Hunter
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DocType()
Default, no-args constructor for implementations to use if needed.This will create theDocType
with the specified element nameThis will create theDocType
with the specified element name and reference to an external DTD.This will create theDocType
with the specified element name and a reference to an external DTD. -
Method Summary
Modifier and TypeMethodDescriptionThis will retrieve the element name being constrained.This returns the data for the internal subset.This will retrieve the public ID of an externally referenced DTD, or an emptyString
if none is referenced.This will retrieve the system ID of an externally referenced DTD, or an emptyString
if none is referenced.getValue()
Returns the empty string since doctypes don't have an XPath 1.0 string value.setElementName
(String elementName) This will set the root element name declared by this DOCTYPE declaration.void
setInternalSubset
(String newData) This sets the data for the internal subset.setPublicID
(String publicID) This will set the public ID of an externally referenced DTD.setSystemID
(String systemID) This will set the system ID of an externally referenced DTD.toString()
This returns aString
representation of theDocType
, suitable for debugging.Methods inherited from class org.jdom.Content
clone, detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
-
Field Details
-
elementName
The element being constrained -
publicID
The public ID of the DOCTYPE -
systemID
The system ID of the DOCTYPE -
internalSubset
The internal subset of the DOCTYPE
-
-
Constructor Details
-
DocType
protected DocType()Default, no-args constructor for implementations to use if needed. -
DocType
This will create theDocType
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 DTDsystemID
-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.IllegalNameException
- if the given root element name is not a legal XML element name.
-
DocType
This will create theDocType
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.IllegalNameException
- if the given root element name is not a legal XML element name.
-
DocType
This will create theDocType
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.
-
-
Method Details
-
getElementName
This will retrieve the element name being constrained.- Returns:
String
- element name for DOCTYPE
-
setElementName
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.
-
getPublicID
This will retrieve the public ID of an externally referenced DTD, or an emptyString
if none is referenced.- Returns:
String
- public ID of referenced DTD.
-
setPublicID
This will set the public ID of an externally referenced DTD.- Parameters:
publicID
- id to set- Returns:
- DocType
DocType
this DocType object - Throws:
IllegalDataException
- if the given public ID is not a legal public ID.
-
getSystemID
This will retrieve the system ID of an externally referenced DTD, or an emptyString
if none is referenced.- Returns:
String
- system ID of referenced DTD.
-
setSystemID
This will set the system ID of an externally referenced DTD.- Parameters:
systemID
- id to set- Returns:
- systemID
String
system ID of referenced DTD. - Throws:
IllegalDataException
- if the given system ID is not a legal system literal.
-
getValue
Returns the empty string since doctypes don't have an XPath 1.0 string value. -
setInternalSubset
This sets the data for the internal subset.- Parameters:
newData
- data for the internal subset, as aString
.
-
getInternalSubset
This returns the data for the internal subset.- Returns:
String
- the internal subset
-
toString
This returns aString
representation of theDocType
, suitable for debugging.
-