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
-
HtmlContainer()
- Create an empty container.
-
HtmlContainer(HtmlElement)
- Create a container containing an HtmlElement.
-
HtmlContainer(HtmlElement, String)
- Create a container containing an HtmlElement, with tags.
-
HtmlContainer(String)
- Create a container containing the given String.
-
HtmlContainer(String, String)
- Create a container containing the given String, with tags.
-
HtmlContainer(Vector)
- Create a container with Strings and HtmlElements.
-
add(HtmlElement)
- Adds HtmlElement to container.
-
add(HtmlElement, String)
- Adds HtmlElement to container surrounded by the tags.
-
add(String)
- Adds Text to container.
-
add(String, String)
- Adds Text to container, with tags.
-
add(Vector)
- Add a group of Strings and HtmlElements to container.
-
addImg(String)
- add an Image.
-
addLink(String, String)
- adds a link to this container
is equivalent to add(text, "a href="+link);
-
addTag(String)
- adds Tag to container
-
addTag(String, String)
- adds Tag to container
-
toString()
- Output container as String.
-
wrap(String)
-
-
write(OutputStream)
- Calls write on each of the elements in this container.
HtmlContainer
public HtmlContainer()
- Create an empty container.
HtmlContainer
public HtmlContainer(Vector elements)
- Create a container with Strings and HtmlElements.
- Parameters:
- Vector - of Strings and HtmlElements to create this Container with
HtmlContainer
public HtmlContainer(HtmlElement element)
- Create a container containing an HtmlElement.
- Parameters:
- element - the HtmlElement to be added to this container
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.
HtmlContainer
public HtmlContainer(String text)
- Create a container containing the given String.
- Parameters:
- text - The text to be added to this container.
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.
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.
add
public void add(HtmlElement element)
- Adds HtmlElement to container.
- Parameters:
- element - the HtmlElement to be added to this container
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.
add
public void add(String text)
- Adds Text to container.
- Parameters:
- text - The text to be added to this container.
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.
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>");
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
addImg
public void addImg(String url)
- add an Image.
adds <img> tag to this container
is equivalent to
addTag("img", "src="+url);
addLink
public void addLink(String text,
String link)
- adds a link to this container
is equivalent to add(text, "a href="+link);
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>
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.
toString
public String toString()
- Output container as String.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index