2004.04.29


com.jdc.xml.tag
Class DocumentType

java.lang.Object
  |
  +--com.jdc.xml.Tag
        |
        +--com.jdc.xml.SimpleTag
              |
              +--com.jdc.xml.tag.DocumentType
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DocumentType

public class DocumentType
extends SimpleTag

DocumentType represents a document type definition, an optional part of an XML document prolog, as specified by the XML standard. The document type definition (DTD) specifies constraints on the valid tags and tag sequences that can exist in the XML document.

In addition to informing a validating parser which tags are valid, and in what arrangements, a DTD informs both validating and nonvalidating parsers where text is expected, which lets the parser determine whether the whitespace it sees is significant or ignorable.

The document type definition is specified after the XML declaration.

Reference: Creating a Document Type Definition

Version:
1.0
Author:
Jay Damon
See Also:
Declaration, Serialized Form

Nested Class Summary
static interface DocumentType.Location
          The Location interface provides valid constant values for the document type definition location attribute.
 
Field Summary
 
Fields inherited from class com.jdc.xml.Tag
LEFT_BRACKET, RIGHT_BRACKET, SLASH, SPACE
 
Constructor Summary
DocumentType()
          Constructs a new DocumentType object.
 
Method Summary
protected  String getAttributes()
          Returns a String of XML document type definition tag attributes.
 DocumentType setFile(String name)
          Sets the document type definition file name.
 DocumentType setLocation(String location)
          Sets the document type definition file location.
 DocumentType setPublic()
          Sets the document type definition file location to be resolved by the parser.
protected  DocumentType setReference(String reference)
          Sets the document type definition reference.
 DocumentType setRoot(String root)
          Sets the document type definition root element.
 DocumentType setSystem()
          Sets the document type definition file location as the local system.
 DocumentType toLowerCase()
          Converts the document type definition tag to lower case.
 
Methods inherited from class com.jdc.xml.SimpleTag
create, create, getEndChar, getStartChar, setEndChar, setStartChar, toString
 
Methods inherited from class com.jdc.xml.Tag
addAttribute, create, getAttribute, getIdentifier, setIdentifier, tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentType

public DocumentType()
Constructs a new DocumentType object.

Method Detail

getAttributes

protected String getAttributes()
Returns a String of XML document type definition tag attributes.

Overrides:
getAttributes in class Tag
Returns:
A String of XML document type definition tag attributes.

setFile

public DocumentType setFile(String name)
Sets the document type definition file name.

Returns:
This document type definition tag.

setLocation

public DocumentType setLocation(String location)
Sets the document type definition file location.

Returns:
This document type definition tag.

setPublic

public DocumentType setPublic()
Sets the document type definition file location to be resolved by the parser.

Returns:
This document type definition tag.

setReference

protected DocumentType setReference(String reference)
Sets the document type definition reference.

Returns:
This document type definition tag.

setRoot

public DocumentType setRoot(String root)
Sets the document type definition root element.

Returns:
This document type definition tag.

setSystem

public DocumentType setSystem()
Sets the document type definition file location as the local system.

Returns:
This document type definition tag.

toLowerCase

public DocumentType toLowerCase()
Converts the document type definition tag to lower case.

Returns:
This document type definition tag.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.