01: /*
02: * Created on Sep 23, 2005
03: */
04: package uk.org.ponder.rsf.renderer;
05:
06: import uk.org.ponder.rsf.components.UIComponent;
07: import uk.org.ponder.rsf.view.View;
08:
09: /** Does the work of rendering a component, given a UIComponent and a location
10: * in the template stream. A ComponentRenderer is specific to a particular
11: * {@link RenderSystem}, which also contains StaticComponentRenderers for rewriting
12: * template data without a corresponding component.
13: * @author Antranig Basman (antranig@caret.cam.ac.uk)
14: */
15:
16: public interface ComponentRenderer {
17: /** Returning this value signifies that a leaf tag has been consumed from the
18: * template, and that the instruction pointer will be stepped along to
19: * end_close + 1.
20: */
21: public static final int LEAF_TAG = 1;
22: /** Returning this value signifies that a trunk tag has been consumed from
23: * the template, and that the instruction pointer will be stepped along to
24: * end_open + 1.
25: */
26: public static final int NESTING_TAG = 2;
27:
28: /** Renders the supplied component.
29: * @param component The component to be rendered (possibly null)
30: * @param view The view in which this component is held
31: * @param renderContext A {@link TagRenderContext} object encapulating the template
32: * location this component is to be rendered with. The <code>nextpos</code>
33: * field in this object will become suitably updated by means of one of the
34: * output methods.
35: */
36:
37: public void renderComponent(UIComponent component, View view,
38: TagRenderContext renderContext);
39: }
|