2004.04.29


com.jdc.xml.tag
Class Declaration

java.lang.Object
  |
  +--com.jdc.xml.Tag
        |
        +--com.jdc.xml.SimpleTag
              |
              +--com.jdc.xml.tag.Declaration
All Implemented Interfaces:
Serializable

public class Declaration
extends SimpleTag

Declaration represents the very first element in an XML document and declares it as XML. The minimal declaration is <?xml version="1.0"?>. The declaration is part of the document prolog.

Reference: A Quick Introduction to XML

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

Nested Class Summary
 class Declaration.Encoding
          The Encoding attribute specifies the XML declaration encoding character set.
 class Declaration.Standalone
          The Standalone attribute specifies whether or not the document references an external entity or an external data type specification.
 class Declaration.Version
          The Version attribute specifies the XML declaration version number.
 
Field Summary
 
Fields inherited from class com.jdc.xml.Tag
LEFT_BRACKET, RIGHT_BRACKET, SLASH, SPACE
 
Constructor Summary
Declaration()
          Constructs a new Declaration object.
 
Method Summary
 Declaration setEncoding(String characterSet)
          Sets the declaration encoding character set.
 Declaration setStandalone(boolean standalone)
          Identifies whether or not this document references an external entity or an external data type specification.
 Declaration setStandalone(String standalone)
          Identifies whether or not this document references an external entity or an external data type specification.
 Declaration setVersion(String number)
          Sets the declaration version number.
 
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, getAttributes, getIdentifier, setIdentifier, tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Declaration

public Declaration()
Constructs a new Declaration object.

Method Detail

setEncoding

public Declaration setEncoding(String characterSet)
Sets the declaration encoding character set. The encoding character set identifies the character set used to encode the data. "ISO-8859-1" is "Latin-1" the Western European and English language character set. The default is compressed Unicode: UTF-8.

Returns:
This declaration tag.

setStandalone

public Declaration setStandalone(boolean standalone)
Identifies whether or not this document references an external entity or an external data type specification. If there are no external references, then true should be specified.

Returns:
This declaration tag.

setStandalone

public Declaration setStandalone(String standalone)
Identifies whether or not this document references an external entity or an external data type specification. If there are no external references, then "yes" should be specified.

Returns:
This declaration tag.

setVersion

public Declaration setVersion(String number)
Sets the declaration version number. The version number identifies the version of the XML markup language used in the data. This attribute is required.

Returns:
This declaration tag.

2004.04.29



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