Markup Rendering - A MarkupContainer also holds/references associated markup which is used to render the container. As the markup stream for a container is rendered, component references in the markup are resolved by using the container to look up Components in the container's component map by id. Each component referenced by the markup stream is given an opportunity to render itself using the markup stream. Components may alter their referring tag, replace the tag's body or insert markup after the tag. But components cannot remove tags from the markup stream. This is an important guarantee because graphic designers may be setting attributes on component tags that affect visual presentation.
The type of markup held in a given container subclass can be determined by calling {@link #getMarkupType()}. Markup is accessed via a MarkupStream object which allows a component to traverse ComponentTag and RawMarkup MarkupElements while rendering a response. Markup in the stream may be HTML or some other kind of markup, such as VXML, as determined by the specific container subclass.
A markup stream may be directly associated with a container via setMarkupStream. However, a container which does not have a markup stream (its getMarkupStream() returns null) may inherit a markup stream from a container above it in the component hierarchy. The {@link #findMarkupStream()} method will locate the first container at or above this containerwhich has a markup stream.
All Page containers set a markup stream before rendering by calling the method {@link #getAssociatedMarkupStream(boolean)} to load the markup associated with the page. SincePage is at the top of the container hierarchy, it is guaranteed that {@link #findMarkupStream()}will always return a valid markup stream.
@see MarkupStream
@author Jonathan Locke