com.bbn.openmap.util.html
Class Document

java.lang.Object
  extended by com.bbn.openmap.util.html.Document
All Implemented Interfaces:
ContainerElement, Element

public class Document
extends java.lang.Object
implements ContainerElement

This class wraps an entire html document (page)


Field Summary
protected  java.lang.String base
          the base URL for this document
protected  ListElement body
          the body of the document
protected  java.lang.String title
          this title of the document
 
Constructor Summary
Document()
          Construct a document with no title and an empty body
Document(java.lang.String title)
          Construct a document with a title but an empty body
 
Method Summary
 void addElement(Element e)
          Add another element to the body of the document
 void addElement(java.lang.String s)
          Add another string to the body of the document
 void generate(java.io.Writer out)
          convert representation to html and write it out
 void generateHeader(java.io.Writer out)
          Write the header to the output
 void setBase(java.lang.String base)
          Writer for the base url
 void setTitle(java.lang.String title)
          Writer for title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

title

protected java.lang.String title
this title of the document


base

protected java.lang.String base
the base URL for this document


body

protected ListElement body
the body of the document

Constructor Detail

Document

public Document()
Construct a document with no title and an empty body


Document

public Document(java.lang.String title)
Construct a document with a title but an empty body

Parameters:
title - the title of the document
Method Detail

setTitle

public void setTitle(java.lang.String title)
Writer for title

Parameters:
title - the new document title

setBase

public void setBase(java.lang.String base)
Writer for the base url

Parameters:
base - the new base URL

addElement

public void addElement(Element e)
Add another element to the body of the document

Specified by:
addElement in interface ContainerElement
Parameters:
e - the element to add

addElement

public void addElement(java.lang.String s)
Add another string to the body of the document

Specified by:
addElement in interface ContainerElement
Parameters:
s - the string to add

generateHeader

public void generateHeader(java.io.Writer out)
                    throws java.io.IOException
Write the header to the output

Parameters:
out - the Writer to dump output to
Throws:
java.io.IOException - an IO error occurred accessing out

generate

public void generate(java.io.Writer out)
              throws java.io.IOException
convert representation to html and write it out

Specified by:
generate in interface Element
Parameters:
out - the output Writer
Throws:
java.io.IOException - an IO error occurred accessing out


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details