Class java.servlet.html.HtmlContainer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.servlet.html.HtmlContainer

java.lang.Object
   |
   +----java.servlet.html.HtmlContainer

public class HtmlContainer
extends Object
implements HtmlElement
A container of HtmlElements

Constructor Index

 o HtmlContainer()
Create an empty container.
 o HtmlContainer(HtmlElement)
Create a container containing an HtmlElement.
 o HtmlContainer(HtmlElement, String)
Create a container containing an HtmlElement, with tags.
 o HtmlContainer(String)
Create a container containing the given String.
 o HtmlContainer(String, String)
Create a container containing the given String, with tags.
 o HtmlContainer(Vector)
Create a container with Strings and HtmlElements.

Method Index

 o add(HtmlElement)
Adds HtmlElement to container.
 o add(HtmlElement, String)
Adds HtmlElement to container surrounded by the tags.
 o add(String)
Adds Text to container.
 o add(String, String)
Adds Text to container, with tags.
 o add(Vector)
Add a group of Strings and HtmlElements to container.
 o addImg(String)
add an Image.
 o addLink(String, String)
adds a link to this container is equivalent to add(text, "a href="+link);
 o addTag(String)
adds Tag to container
 o addTag(String, String)
adds Tag to container
 o toString()
Output container as String.
 o wrap(String)
 o write(OutputStream)
Calls write on each of the elements in this container.

Constructors

 o HtmlContainer
  public HtmlContainer()
Create an empty container.
 o HtmlContainer
  public HtmlContainer(Vector elements)
Create a container with Strings and HtmlElements.
Parameters:
Vector - of Strings and HtmlElements to create this Container with
 o HtmlContainer
  public HtmlContainer(HtmlElement element)
Create a container containing an HtmlElement.
Parameters:
element - the HtmlElement to be added to this container
 o HtmlContainer
  public HtmlContainer(HtmlElement element,
                       String tags)
Create a container containing an HtmlElement, with tags.
Parameters:
element - The HtmlElement to be added to this container.
tags - Comma delimmitted list of tags to wrap around this text.
 o HtmlContainer
  public HtmlContainer(String text)
Create a container containing the given String.
Parameters:
text - The text to be added to this container.
 o HtmlContainer
  public HtmlContainer(String text,
                       String tags)
Create a container containing the given String, with tags.
Parameters:
text - the text to be added to this container
tags - comma delimmitted list of tags to wrap around this text.

Methods

 o add
  public void add(Vector elements)
Add a group of Strings and HtmlElements to container.
Parameters:
Vector - of Strings and HtmlElements to add to container.
 o add
  public void add(HtmlElement element)
Adds HtmlElement to container.
Parameters:
element - the HtmlElement to be added to this container
 o add
  public void add(HtmlElement element,
                  String tags)
Adds HtmlElement to container surrounded by the tags. this call is equivalent to element.wrap(tags); add(element);
Parameters:
element - The HtmlElement to be added to this container.
tags - Comma delimmitted list of tags to wrap around this element.
 o add
  public void add(String text)
Adds Text to container.
Parameters:
text - The text to be added to this container.
 o add
  public void add(String text,
                  String tags)
Adds Text to container, with tags. add("jeeves", "b, a href=jeeves.html") is equivalent to add("<b><a href=jeeves.html>jeeves</a></b>");
Parameters:
text - The text to be added to this container.
tags - comma delimmitted list of tags to wrap around this text.
 o addTag
  public void addTag(String tag)
adds Tag to container
Parameters:
tag - the Tag to be added to this container addTag("P") is equivalent to add("<P>");
 o addTag
  public void addTag(String tag,
                     String attribs)
adds Tag to container
Parameters:
tag - the Tag to be added to this container
attribs - the attributes of this tag
 o addImg
  public void addImg(String url)
add an Image. adds <img> tag to this container is equivalent to addTag("img", "src="+url);
 o addLink
  public void addLink(String text,
                      String link)
adds a link to this container is equivalent to add(text, "a href="+link);
 o wrap
  public void wrap(String tags)
Parameters:
tags - String of comma delimmitted tags to wrap around this text. ie.
text.wrap("b, a href=foo.html");
generates:
<b><a href=foo.html>the text for this Element</a></b>
 o write
  public void write(OutputStream out) throws IOException
Calls write on each of the elements in this container.
Parameters:
out - OutputStream container will write html to.
 o toString
  public String toString()
Output container as String.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index