| |
|
| java.lang.Object org.mortbay.html.Element org.mortbay.html.Composite
All known Subclasses: org.mortbay.html.Text, org.mortbay.html.Comment, org.mortbay.html.Page, org.mortbay.html.Block,
Composite | public class Composite extends Element (Code) | | HTML Composite Element.
This class is can be used a either an abstract or concrete
holder of other HTML elements.
Used directly, it allow multiple HTML Elements to be added which
are produced sequentially.
Derived used of Composite may wrap each contain Element in
special purpose HTML tags (e.g. list).
Notes
Elements are added to the Composite either as HTML Elements or as
Strings. Other objects added to the Composite are converted to Strings
See Also: Element version: $Id: Composite.java,v 1.6 2004/05/09 20:31:28 gregwilkins Exp $ author: Greg Wilkins |
elements | protected ArrayList elements(Code) | | The vector of elements in this Composite.
|
Composite | public Composite()(Code) | | Default constructor.
|
Composite | public Composite(String attributes)(Code) | | Default constructor.
|
add | public Composite add(Object o)(Code) | | Add an Object to the Composite by converting it to a Element or.
String
Parameters: o - The Object to add. If it is a String or Element, it isadded directly, otherwise toString() is called. This Composite (for chained commands) |
contents | public String contents()(Code) | | Contents of the composite.
|
nest | public Composite nest(Composite c)(Code) | | Nest a Composite within a Composite.
The passed Composite is added to this Composite. Adds to
this composite are actually added to the nested Composite.
Calls to nest are passed the nested Composite
The Composite to unest on to return to the originalstate. |
replace | public boolean replace(Object oldObj, Object newObj)(Code) | | Replace an object within the composite.
|
setNest | public Composite setNest(Composite c)(Code) | | Explicit set of the Nested component.
No add is performed. setNest() obeys any current nesting and
sets the nesting of the nested component.
|
size | public int size()(Code) | | The number of Elements in this Composite.
The number of elements in this Composite |
write | public void write(Writer out) throws IOException(Code) | | Write the composite.
The default implementation writes the elements sequentially. May
be overridden for more specialized behaviour.
Parameters: out - Writer to write the element to. |
|
|
|