org.apache.ecs
Class Doctype

java.lang.Object
  |
  +--org.apache.ecs.GenericElement
        |
        +--org.apache.ecs.ElementAttributes
              |
              +--org.apache.ecs.ConcreteElement
                    |
                    +--org.apache.ecs.SinglePartElement
                          |
                          +--org.apache.ecs.Doctype
All Implemented Interfaces:
Attributes, java.lang.Cloneable, Element, ElementRegistry, Printable, java.io.Serializable
Direct Known Subclasses:
Doctype.Html401Frameset, Doctype.Html401Strict, Doctype.Html401Transitional, Doctype.Html40Frameset, Doctype.Html40Strict, Doctype.Html40Transitional, Doctype.XHtml10Frameset, Doctype.XHtml10Strict, Doctype.XHtml10Transitional

public class Doctype
extends SinglePartElement
implements Printable

This class creates a <!DOCTYPE> tag.

Format:
<!DOCTYPE [name] [visibility] [identifier] [uri]>

usage:
Document d = new Document()
.setDoctype(new Doctype.Html40Strict())

or

XMLDocument d = new XMLDocument()
.addToProlog( new Doctype( "foo", "\"--/bar/baz/en\"", "\"http://qoz.net/foo.dtd\"" );
.addElement( new XML( ...

Version:
$Id: Doctype.java,v 1.6 2003/04/27 09:43:30 rdonkin Exp $
Author:
Michael Heuer, Stephan Nagy, Jon S. Stevens, Bruce Durling, Bojan Smojver, Yuji Kumasaka
See Also:
Doctype.Html40Strict, Doctype.Html40Transitional, Doctype.Html40Frameset, Doctype.XHtml10Strict, Doctype.XHtml10Transitional, Doctype.XHtml10Frameset, Serialized Form

Inner Class Summary
static class Doctype.Html401Frameset
          The HTML 4.01 Frameset DTD includes everything in the transitional DTD plus frames as well.
static class Doctype.Html401Strict
          The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents.
static class Doctype.Html401Transitional
          The HTML 4.01 Transitional DTD includes everything in the strict DTD plus deprecated elements and attributes (most of which concern visual presentation).
static class Doctype.Html40Frameset
          The HTML 4.0 Frameset DTD includes everything in the transitional DTD plus frames as well.
static class Doctype.Html40Strict
          The HTML 4.0 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents.
static class Doctype.Html40Transitional
          The HTML 4.0 Transitional DTD includes everything in the strict DTD plus deprecated elements and attributes (most of which concern visual presentation).
static class Doctype.XHtml10Frameset
          The XHTML 1.0 Frameset DTD This is the same as HTML 4.0 Frameset except for changes due to the differences between XML and SGML.
static class Doctype.XHtml10Strict
          The XHTML 1.0 Strict DTD This is the same as HTML 4.0 Strict except for changes due to the differences between XML and SGML.
static class Doctype.XHtml10Transitional
          The XHTML 1.0 Transitional DTD This is the same as HTML 4.0 Transitional except for changes due to the differences between XML and SGML.
 
Field Summary
static java.lang.String elementName
           
protected  java.lang.String identifier
           
protected  java.lang.String name
           
static java.lang.String PUBLIC
           
protected  java.lang.String uri
           
protected  java.lang.String visibility
           
 
Fields inherited from class org.apache.ecs.ConcreteElement
lineSeparator, registry, registryList
 
Fields inherited from class org.apache.ecs.ElementAttributes
attribute_equality_sign, attribute_filter, attribute_quote, attribute_quote_char, filter_attribute_state
 
Fields inherited from class org.apache.ecs.GenericElement
__text, _defaultFilter, begin_end_modifier, begin_end_modifier_defined, begin_start_modifier, begin_start_modifier_defined, case_type, codeset, element, element_type, end_element, end_end_modifier, end_end_modifier_defined, end_modifier_defined, end_start_modifier, end_start_modifier_defined, end_tag, filter, filter_state, position, pretty_print, start_modifier_defined, start_tag, tabLevel, VERSION
 
Fields inherited from interface org.apache.ecs.Attributes
NO_ATTRIBUTE_VALUE
 
Fields inherited from interface org.apache.ecs.Element
CENTER, LEFT, LOWERCASE, MIXEDCASE, RIGHT, UPPERCASE
 
Constructor Summary
Doctype()
          Basic Constructor.
Doctype(java.lang.String name, java.lang.String id, java.lang.String uri)
          Constructor.
Doctype(java.lang.String name, java.lang.String visibility, java.lang.String id, java.lang.String uri)
          Constructor.
 
Method Summary
(package private)  void ()
          Private Initializer
 Doctype addElement(Element element)
          Adds an Element to the element.
 Doctype addElement(java.lang.String element)
          Adds an Element to the element.
 Doctype addElement(java.lang.String hashcode, Element element)
          Adds and Element to the element.
 Doctype addElement(java.lang.String hashcode, java.lang.String element)
          Adds an Element to the element.
 Doctype removeElement(java.lang.String hashcode)
          Removes an Element from the element.
 Doctype setIdentifier(java.lang.String identifier)
          Updates the name of the public identifier.
 Doctype setName(java.lang.String name)
          Updates the name of the root element.
 Doctype setUri(java.lang.String uri)
          Updates the URI of the dtd.
 Doctype setVisibility(java.lang.String visibility)
          Updates the name of the root element.
protected  void updateElementType()
          Should be called when any of the fields are changed.
 
Methods inherited from class org.apache.ecs.ConcreteElement
addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, addElementToRegistry, clone, elements, getElement, isEmpty, keys, output, output, output, output, registryHasElement, registryHasElement, removeElementFromRegistry, removeElementFromRegistry
 
Methods inherited from class org.apache.ecs.ElementAttributes
addAttribute, addAttribute, addAttribute, addAttribute, attributes, createStartTag, getAttribute, getAttributeEqualitySign, getAttributeFilter, getAttributeFilterState, getAttributeQuote, getAttributeQuoteChar, hasAttribute, removeAttribute, setAttributeEqualitySign, setAttributeFilter, setAttributeFilterState, setAttributeQuote, setAttributeQuoteChar, setClass, setDir, setID, setLang, setStyle, setTitle
 
Methods inherited from class org.apache.ecs.GenericElement
alterCase, createEndTag, getBeginEndModifier, getBeginEndModifierDefined, getBeginStartModifier, getBeginStartModifierDefined, getCase, getCodeSet, getElementHashEntry, getElementType, getEndEndModifier, getEndEndModifierDefined, getEndStartModifier, getEndStartModifierDefined, getEndTagChar, getFilter, getFilterState, getNeedClosingTag, getNeedLineBreak, getPrettyPrint, getStartTagChar, getTabLevel, getTagPosition, getTagText, getVersion, putTabs, putTabs, removeBeginEndModifier, removeBeginStartModifier, removeEndEndModifier, removeEndStartModifier, setBeginEndModifier, setBeginEndModifierDefined, setBeginModifier, setBeginModifier, setBeginStartModifier, setBeginStartModifierDefined, setCase, setCodeSet, setElementType, setEndEndModifier, setEndEndModifierDefined, setEndModifier, setEndModifier, setEndStartModifier, setEndStartModifierDefined, setEndTagChar, setFilter, setFilterState, setNeedClosingTag, setPrettyPrint, setStartTagChar, setTabLevel, setTagPosition, setTagText, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

elementName

public static final java.lang.String elementName

PUBLIC

public static final java.lang.String PUBLIC

name

protected java.lang.String name

visibility

protected java.lang.String visibility

identifier

protected java.lang.String identifier

uri

protected java.lang.String uri
Constructor Detail

Doctype

public Doctype()
Basic Constructor.

Doctype

public Doctype(java.lang.String name,
               java.lang.String id,
               java.lang.String uri)
Constructor.
Parameters:
name - Root element of the XML document.
id - Public identifier.
uri - URI of the DTD.

Doctype

public Doctype(java.lang.String name,
               java.lang.String visibility,
               java.lang.String id,
               java.lang.String uri)
Constructor.
Parameters:
name - Root element of the XML document.
id - Public identifier.
uri - URI of the DTD.
Method Detail

void ()
Description copied from class: SinglePartElement
Private Initializer
Overrides:
in class SinglePartElement

updateElementType

protected void updateElementType()
Should be called when any of the fields are changed.

setName

public Doctype setName(java.lang.String name)
Updates the name of the root element.
Parameters:
name - Name of the root element.
Returns:
a value of type 'Doctype'

setVisibility

public Doctype setVisibility(java.lang.String visibility)
Updates the name of the root element.
Parameters:
name - Name of the root element.
Returns:
a value of type 'Doctype'

setIdentifier

public Doctype setIdentifier(java.lang.String identifier)
Updates the name of the public identifier.
Parameters:
identifier - The public identifier.
Returns:
a value of type 'Doctype'

setUri

public Doctype setUri(java.lang.String uri)
Updates the URI of the dtd.
Parameters:
uri - URI of the dtd.
Returns:
a value of type 'Doctype'

addElement

public Doctype addElement(java.lang.String hashcode,
                          Element element)
Adds and Element to the element.
Parameters:
hashcode - name of the element for hash table.
element - Adds an Element to the element.
Returns:
a value of type 'Doctype'

addElement

public Doctype addElement(java.lang.String hashcode,
                          java.lang.String element)
Adds an Element to the element.
Parameters:
hashcode - name of the element for the hash table.
element - Adds an Element to the element.
Returns:
a value of type 'Doctype'

addElement

public Doctype addElement(Element element)
Adds an Element to the element.
Parameters:
element - Adds an Element to the element.
Returns:
a value of type 'Doctype'

addElement

public Doctype addElement(java.lang.String element)
Adds an Element to the element.
Parameters:
element - Adds an Element to the element.
Returns:
a value of type 'Doctype'

removeElement

public Doctype removeElement(java.lang.String hashcode)
Removes an Element from the element.
Parameters:
hashcode - the name of the element to be removed.
Returns:
a value of type 'Doctype'


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.