Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui
Class ElementRenderer

java.lang.Object
  |
  +--oracle.cabo.ui.BaseRenderer
        |
        +--oracle.cabo.ui.ElementRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
HTMLElementRenderer

public class ElementRenderer
extends BaseRenderer

Renderer implementation that can output elements. This base implementation outputs no attributes; clients must override renderAttributes(). It will output the start and element tags, based on the return value of getElementName().


Fields inherited from class oracle.cabo.ui.BaseRenderer
NO_CHILD_INDEX
 
Constructor Summary
ElementRenderer()
          Creates an ElementRenderer
 
Method Summary
protected  java.lang.String getElementName(RenderingContext context, UINode node)
          Called to retrieve the element name to render.
static Renderer getRenderer()
          Returns a shared instance of this renderer.
protected  void postrender(RenderingContext context, UINode node)
          Called to render the portion after the contents.
protected  void prerender(RenderingContext context, UINode node)
          Called to render the portion before the contents.
protected  void renderAttribute(RenderingContext context, java.lang.String name, java.lang.Object value)
          Renders a single attribute.
protected  void renderAttribute(RenderingContext context, UINode node, java.lang.String name, AttributeKey valueKey)
          Renders a single attribute, getting the value from the UINode.
protected  void renderAttribute(RenderingContext context, UINode node, java.lang.String name, AttributeKey valueKey, java.lang.Object defaultValue)
          Renders a single attribute, getting the value from the UINode, and substituting a default value if the node doesn't have that attribute set.
protected  void renderAttribute(RenderingContext context, UINode node, java.lang.String name, java.lang.Object defaultValue)
          Renders a single attribute, getting the value from the UINode, and substituting a default value if the node doesn't have that attribute set.
protected  void renderAttributes(RenderingContext context, UINode node)
          Renders attributes of the current node.
 
Methods inherited from class oracle.cabo.ui.BaseRenderer
getNextRenderedChildIndex, getNextRenderedChildNode, getVisibleIndexedChildCount, render, renderBetweenIndexedChildren, renderBetweenIndexedChildren, renderChild, renderContent, renderIndexedChild, renderIndexedChild, renderNamedChild, renderNamedChild, skipChild, skipNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementRenderer

public ElementRenderer()
Creates an ElementRenderer
Method Detail

getRenderer

public static Renderer getRenderer()
Returns a shared instance of this renderer.

prerender

protected void prerender(RenderingContext context,
                         UINode node)
                  throws java.io.IOException
Called to render the portion before the contents. This implementation will output a start element tag and call renderAttributes(). Uses the element name returned by getElementName().
Overrides:
prerender in class BaseRenderer
Parameters:
context - the rendering context
node - the current UINode
See Also:
renderAttributes(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode), getElementName(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

postrender

protected void postrender(RenderingContext context,
                          UINode node)
                   throws java.io.IOException
Called to render the portion after the contents. This implementation outputs a close element tag. Uses the element name returned by getElementName().
Overrides:
postrender in class BaseRenderer
Parameters:
context - the rendering context
node - the current UINode
See Also:
getElementName(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

renderAttributes

protected void renderAttributes(RenderingContext context,
                                UINode node)
                         throws java.io.IOException
Renders attributes of the current node. The default implementation does not render any attributes; subclasses should override this method if they need to output attributes.
Parameters:
context - the rendering context
node - the current UINode

renderAttribute

protected void renderAttribute(RenderingContext context,
                               java.lang.String name,
                               java.lang.Object value)
                        throws java.io.IOException
Renders a single attribute. Default implementation does nothing if the value is null; otherwise, uses the current output method to render an attribute.
Parameters:
context - the rendering context
name - the attribute name for rendering
value - the attribute value

renderAttribute

protected final void renderAttribute(RenderingContext context,
                                     UINode node,
                                     java.lang.String name,
                                     AttributeKey valueKey)
                              throws java.io.IOException
Renders a single attribute, getting the value from the UINode.
Parameters:
context - the rendering context
node - the node to get the attribute from
name - the attribute name for rendering
valueKey - the key to use to retrieve the attribute

renderAttribute

protected final void renderAttribute(RenderingContext context,
                                     UINode node,
                                     java.lang.String name,
                                     AttributeKey valueKey,
                                     java.lang.Object defaultValue)
                              throws java.io.IOException
Renders a single attribute, getting the value from the UINode, and substituting a default value if the node doesn't have that attribute set.
Parameters:
context - the rendering context
node - the node to get the attribute from
name - the attribute name for rendering
valueKey - the key to use to retrieve the attribute
defaultValue - the default value to use if the attribute isn't set

renderAttribute

protected final void renderAttribute(RenderingContext context,
                                     UINode node,
                                     java.lang.String name,
                                     java.lang.Object defaultValue)
                              throws java.io.IOException
Renders a single attribute, getting the value from the UINode, and substituting a default value if the node doesn't have that attribute set. This convenience method will use the same name for rendering the attribute as for retrieving it from the UINode.
Parameters:
context - the rendering context
node - the node to get the attribute from
name - the attribute name for rendering and for retrieving the value
defaultValue - the default value to use if the attribute isn't set

getElementName

protected java.lang.String getElementName(RenderingContext context,
                                          UINode node)
Called to retrieve the element name to render. Default implementation just uses the UINode's local name.
Parameters:
context - the rendering context
node - the current node

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.