org.apache.ecs
Class Document

java.lang.Object
  |
  +--org.apache.ecs.Document
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Document
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class creates a Document container, for convience.

Version:
$Id: Document.java,v 1.10 2003/04/27 09:43:30 rdonkin Exp $
Author:
Stephan Nagy, Jon S. Stevens
See Also:
Serialized Form

Field Summary
private  Body body
           
private  java.lang.String codeset
           
private  Doctype doctype
           
private  Head head
           
private  Html html
           
private  Title title
           
 
Constructor Summary
Document()
          Basic constructor.
Document(java.lang.String codeset)
          Basic constructor.
 
Method Summary
(package private)  void ()
           
 Document appendBody(Element value)
          Append to the body element for this document container.
 Document appendBody(java.lang.String value)
          Append to the body element for this document container.
 Document appendHead(Element value)
          Append to the head element for this document container.
 Document appendHead(java.lang.String value)
          Append to the head element for this document container.
 Document appendTitle(Element value)
          Append to the title element for this document container.
 Document appendTitle(java.lang.String value)
          Append to the title element for this document container.
 java.lang.Object clone()
          Allows the document to be cloned.
 Body getBody()
          Get the body element for this document container.
 java.lang.String getCodeset()
          Gets the codeset for this Document
 Doctype getDoctype()
          Get the doctype element for this document container.
 Head getHead()
          Get the head element for this document container.
 Html getHtml()
          Get the html element for this document container.
 Title getTitle()
          Get the title element for this document container.
 void output(java.io.OutputStream out)
          Write the container to the OutputStream
 void output(java.io.PrintWriter out)
          Write the container to the PrintWriter
 Document setBody(Body set_body)
          Set the Body element for this document container.
 void setCodeset(java.lang.String codeset)
          Sets the codeset for this Document
 Document setDoctype(Doctype set_doctype)
          Set the doctype element for this document container.
 Document setHead(Head set_head)
          Set the head element for this document container.
 Document setHtml(Html set_html)
          Set the html element for this document container.
 Document setTitle(Title set_title)
          Set the Title element for this document container.
 java.lang.String toString()
          Override the toString() method so that it prints something meaningful.
 java.lang.String toString(java.lang.String codeset)
          Override the toString() method so that it prints something meaningful.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

html

private Html html

head

private Head head

body

private Body body

title

private Title title

codeset

private java.lang.String codeset

doctype

private Doctype doctype
Constructor Detail

Document

public Document()
Basic constructor.

Document

public Document(java.lang.String codeset)
Basic constructor. Sets the codeset for the page output.
Method Detail

void ()
Overrides:
in class java.lang.Object

getDoctype

public Doctype getDoctype()
Get the doctype element for this document container.

setDoctype

public Document setDoctype(Doctype set_doctype)
Set the doctype element for this document container.

getHtml

public Html getHtml()
Get the html element for this document container.

setHtml

public Document setHtml(Html set_html)
Set the html element for this document container.

getHead

public Head getHead()
Get the head element for this document container.

setHead

public Document setHead(Head set_head)
Set the head element for this document container.

appendHead

public Document appendHead(Element value)
Append to the head element for this document container.
Parameters:
value - adds to the value between the head tags

appendHead

public Document appendHead(java.lang.String value)
Append to the head element for this document container.
Parameters:
value - adds to the value between the head tags

getBody

public Body getBody()
Get the body element for this document container.

setBody

public Document setBody(Body set_body)
Set the Body element for this document container.

appendBody

public Document appendBody(Element value)
Append to the body element for this document container.
Parameters:
value - adds to the value between the body tags

appendBody

public Document appendBody(java.lang.String value)
Append to the body element for this document container.
Parameters:
value - adds to the value between the body tags

getTitle

public Title getTitle()
Get the title element for this document container.

setTitle

public Document setTitle(Title set_title)
Set the Title element for this document container.

appendTitle

public Document appendTitle(Element value)
Append to the title element for this document container.
Parameters:
value - adds to the value between the title tags

appendTitle

public Document appendTitle(java.lang.String value)
Append to the title element for this document container.
Parameters:
value - adds to the value between the title tags

setCodeset

public void setCodeset(java.lang.String codeset)
Sets the codeset for this Document

getCodeset

public java.lang.String getCodeset()
Gets the codeset for this Document
Returns:
the codeset

output

public void output(java.io.OutputStream out)
Write the container to the OutputStream

output

public void output(java.io.PrintWriter out)
Write the container to the PrintWriter

toString

public final java.lang.String toString()
Override the toString() method so that it prints something meaningful.
Overrides:
toString in class java.lang.Object

toString

public final java.lang.String toString(java.lang.String codeset)
Override the toString() method so that it prints something meaningful.

clone

public java.lang.Object clone()
Allows the document to be cloned. Doesn't return an instance of document returns instance of Html. NOTE: If you have a doctype set, then it will be lost. Feel free to submit a patch to fix this. It isn't trivial.
Overrides:
clone in class java.lang.Object


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