Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui
Class RootRenderingContext

java.lang.Object
  |
  +--oracle.cabo.ui.LogicalNodeRenderingContext
        |
        +--oracle.cabo.ui.RenderedNodeRenderingContext
              |
              +--oracle.cabo.ui.RootRenderingContext
All Implemented Interfaces:
java.lang.Cloneable, ImageContext, RenderingContext, StyleContext
Direct Known Subclasses:
ServletRenderingContext

public class RootRenderingContext
extends RenderedNodeRenderingContext
implements StyleContext, ImageContext

Default implementation of RenderingContext used as the root for rendering a tree of UINodes. Developers that need to render UINode content outside of a Servlet or JSP should use this class, but all others should use its subclass, ServletRenderingContext.


Fields inherited from interface oracle.cabo.ui.RenderingContext
CONTEXT_PATH_PROPERTY, CONTEXT_URI_PROPERTY, SHARED_CONTEXT_PATH_PROPERTY, SHARED_CONTEXT_URI_PROPERTY
 
Constructor Summary
RootRenderingContext()
          Creates a RootRenderingContext using the default RendererManager instance.
RootRenderingContext(OutputMethod method)
          Deprecated. Use the no-argument constructor, and call prepareOutput(java.io.PrintWriter, java.io.OutputStream, java.lang.String, java.lang.String)
RootRenderingContext(OutputMethod method, RendererManager manager)
          Deprecated. Use the no-argument constructor, and call prepareOutput(java.io.PrintWriter, java.io.OutputStream, java.lang.String, java.lang.String)
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the RenderingContext.
protected  ErrorLog createErrorLog()
          Responsible for creating an error log for the rendering context.
protected  OutputMethod createOutputMethod()
          Responsible for creating an output method.
protected  OutputMethod createOutputMethod(java.io.PrintWriter outWriter, java.io.OutputStream stream, java.lang.String contentType, java.lang.String encoding)
          Responsible for creating an output method.
 Agent getAgent()
          Returns an Agent object that can be used to identify what device will display the rendering.
protected  Agent getBaseAgent()
          Returns the "base agent", which has not yet been affected by the choice of a rendering facet.
 Configuration getConfiguration()
          Returns a Configuration object that will be used to locate paths and return global properties.
 DataObject getDataObject(RenderingContext context, java.lang.String namespaceURI, java.lang.String name)
          Returns the DataObject for the given namespace and name pair.
 DataObject getDataObject(java.lang.String namespaceURI, java.lang.String name)
          Returns the DataObject for the given namespace and name pair.
protected  int getDefaultDataProviderSize()
          Returns the default initial number of DataProvider slots to allocate.
protected  int getDefaultNodeStackSize()
          Returns the default initial number of nodes in the stack of logical nodes.
protected  int getDefaultPropertyMapSize()
          Returns the default size of the PropertyMap used to store properties on the RenderingContext.
 ErrorLog getErrorLog()
          Get an interface that can be used to log errors.
 java.lang.String getFacet()
          Returns the rendering facet in use.
 ImageContext getImageContext()
          Get an interface that can be used for image lookups and rendering.
 LocaleContext getLocaleContext()
          Returns the LocaleContext that should be used for rendering.
 LookAndFeel getLookAndFeel()
          Returns the LookAndFeel to use for this render.
 OutputMethod getOutputMethod()
          Returns the OutputMethod that should be used for rendering text.
 RenderingContext getParentContext()
          Returns the RenderingContext that this context should delegate calls to pushRenderedChild, popRenderedChild, and addDataProvider to.
 java.lang.Object getProperty(java.lang.String namespace, java.lang.Object key)
          Gets a property stored on the context.
 RendererManager getRendererManager()
          Returns the RendererManager that should be used for finding renderers.
 StyleContext getStyleContext()
          Get an interface that can be used for style lookups and generation.
 URLEncoder getURLEncoder()
          This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
 void prepareOutput(java.io.PrintWriter outWriter, java.io.OutputStream stream, java.lang.String contentType, java.lang.String encoding)
          Prepares the output of the rendering context.
 void resetProperties()
          Clears all properties from the context.
 void setConfiguration(Configuration config)
          Sets the configuration for use with this rendering pass.
 void setConfiguration(java.lang.String configName)
          Sets a configuration by name, for use with this rendering pass.
 void setDataObject(java.lang.String namespaceURI, java.lang.String name, DataObject dataObject)
          Stores a data object on the context.
 void setDataObjectDictionary(java.lang.String namespaceURI, java.util.Dictionary dataObjectDict)
          Registers a dictionary for use in retrieving and storing data objects for a single namespace.
 void setErrorLog(ErrorLog log)
          Get an interface that can be used to log errors.
 void setFacet(java.lang.String facet)
          Sets the facet of the current look-and-feel.
 void setURLEncoder(URLEncoder urlEncoder)
          This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
 java.lang.String transformName(java.lang.String baseName)
          Transforms a UINode Name to a name suitable for rendering, given the current RenderingContext state.
 
Methods inherited from class oracle.cabo.ui.RenderedNodeRenderingContext
getLocalProperty, getRenderedAncestorNode, getRenderedAncestorNodeCount, popRenderedChild, pushRenderedChild, reset, setLocalProperty, setProperty
 
Methods inherited from class oracle.cabo.ui.LogicalNodeRenderingContext
addDataProvider, getAncestorNode, getAncestorNodeCount, getCurrentDataObject, getPath, popChild, pushChild, setCurrentDataObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.cabo.style.StyleContext
setProperty
 
Methods inherited from interface oracle.cabo.image.ImageContext
setProperty
 

Constructor Detail

RootRenderingContext

public RootRenderingContext()
Creates a RootRenderingContext using the default RendererManager instance.

RootRenderingContext

public RootRenderingContext(OutputMethod method)
Deprecated. Use the no-argument constructor, and call prepareOutput(java.io.PrintWriter, java.io.OutputStream, java.lang.String, java.lang.String)

Creates a RootRenderingContext using the default RendererManager instance.

RootRenderingContext

public RootRenderingContext(OutputMethod method,
                            RendererManager manager)
Deprecated. Use the no-argument constructor, and call prepareOutput(java.io.PrintWriter, java.io.OutputStream, java.lang.String, java.lang.String)

Creates a RootRenderingContext.
Method Detail

setConfiguration

public void setConfiguration(java.lang.String configName)
Sets a configuration by name, for use with this rendering pass. If set to null, the configuration will return to the default behavior. The Configuration must have already been created and registered.

setConfiguration

public void setConfiguration(Configuration config)
Sets the configuration for use with this rendering pass. If set to null, the configuration will return to the default behavior.

getLookAndFeel

public LookAndFeel getLookAndFeel()
Returns the LookAndFeel to use for this render.

getFacet

public java.lang.String getFacet()
Returns the rendering facet in use.

setFacet

public void setFacet(java.lang.String facet)
Sets the facet of the current look-and-feel. This must not be called after getRendererManager()

prepareOutput

public void prepareOutput(java.io.PrintWriter outWriter,
                          java.io.OutputStream stream,
                          java.lang.String contentType,
                          java.lang.String encoding)
                   throws java.io.IOException
Prepares the output of the rendering context. After this method has been called, the OutputMethod of the page will be available and correctly initialized.
Parameters:
outWriter - a PrintWriter
stream - an OutputStream, if binary output is used. This is not currently supported, and must be null.
contentType - the MIME type of the page. eg: "text/html"
encoding - the character encoding of the output. "null" is a legal value if the encoding is unknown, but it is strongly encouraged to pass the correct value. eg: "UTF-8"

getRendererManager

public RendererManager getRendererManager()
Returns the RendererManager that should be used for finding renderers. The default implementation returns the manager registered on the Configuration, if any; if that fails, it returns a globally shared instance,

getLocaleContext

public LocaleContext getLocaleContext()
Returns the LocaleContext that should be used for rendering. The LocaleContext is the owner of all LocaleSpecific information about the Locale.
Specified by:
getLocaleContext in interface StyleContext

getOutputMethod

public OutputMethod getOutputMethod()
                             throws java.io.IOException
Returns the OutputMethod that should be used for rendering text.

getAgent

public Agent getAgent()
Returns an Agent object that can be used to identify what device will display the rendering. Default implementation returns the "unknown browser" agent.
Specified by:
getAgent in interface StyleContext

getBaseAgent

protected Agent getBaseAgent()
Returns the "base agent", which has not yet been affected by the choice of a rendering facet. Subclassers should override this method, not getAgent(), to affect the default.

setDataObject

public void setDataObject(java.lang.String namespaceURI,
                          java.lang.String name,
                          DataObject dataObject)
Stores a data object on the context. Clients using this method should strongly consider whether their code might function more effectively by overriding getDataObject(), and, for their namespaces, dynamically instantiating DataObjects.
Parameters:
namespaceURI - the namespace of the data object
name - the namespace of the data object
dataObject - the data object

setDataObjectDictionary

public void setDataObjectDictionary(java.lang.String namespaceURI,
                                    java.util.Dictionary dataObjectDict)
Registers a dictionary for use in retrieving and storing data objects for a single namespace. Any data objects previously registered for that namespace will be dropped. If the dictionary is null, all data objects for that namespace will be deleted.
Parameters:
namespaceURI - the namespace of the data object
dataObjectDict - a Dictionary of data objects

getDataObject

public final DataObject getDataObject(java.lang.String namespaceURI,
                                      java.lang.String name)
Returns the DataObject for the given namespace and name pair. It will call each data provider added with addDataProvider, starting with the most recently added, until one returns non-null. Then, it will look for DataObjects added with setDataObject(). Developers cannot override this method; they must override the 3-argument getDataObject().
Overrides:
getDataObject in class LogicalNodeRenderingContext
Following copied from interface: oracle.cabo.ui.RenderingContext
See Also:
RenderingContext.addDataProvider(oracle.cabo.ui.data.DataProvider)

getDataObject

public DataObject getDataObject(RenderingContext context,
                                java.lang.String namespaceURI,
                                java.lang.String name)
Returns the DataObject for the given namespace and name pair. It will call each data provider added with addDataProvider, starting with the most recently added, until one returns non-null. Then, it will look for DataObjects added with setDataObject().
Overrides:
getDataObject in class LogicalNodeRenderingContext
Since:
2.0.12

getProperty

public java.lang.Object getProperty(java.lang.String namespace,
                                    java.lang.Object key)
Gets a property stored on the context.
Specified by:
getProperty in interface StyleContext
Overrides:
getProperty in class RenderedNodeRenderingContext

transformName

public java.lang.String transformName(java.lang.String baseName)
Transforms a UINode Name to a name suitable for rendering, given the current RenderingContext state.

getURLEncoder

public URLEncoder getURLEncoder()
This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
See Also:
RenderingContext.getURLEncoder()

setURLEncoder

public void setURLEncoder(URLEncoder urlEncoder)
This implementation returns an encoder that does no special encoding, and returns an empty string as the default URL.
See Also:
RenderingContext.getURLEncoder()

getConfiguration

public Configuration getConfiguration()
Returns a Configuration object that will be used to locate paths and return global properties.
Specified by:
getConfiguration in interface StyleContext

getErrorLog

public ErrorLog getErrorLog()
Get an interface that can be used to log errors.
Specified by:
getErrorLog in interface StyleContext

setErrorLog

public void setErrorLog(ErrorLog log)
Get an interface that can be used to log errors.

getImageContext

public ImageContext getImageContext()
Get an interface that can be used for image lookups and rendering.

getStyleContext

public StyleContext getStyleContext()
Get an interface that can be used for style lookups and generation.
Specified by:
getStyleContext in interface ImageContext

getParentContext

public final RenderingContext getParentContext()
Description copied from interface: RenderingContext
Returns the RenderingContext that this context should delegate calls to pushRenderedChild, popRenderedChild, and addDataProvider to. The parent context acts to segregate the logical node structure internal to a composite UINode from the deceloper's logical UINode structure. By calling getParentContext.getAncestorNode(0) the composite UINode gains access to the UINode that the composite UINode is attempting to render.

Typically, only composite UINode implementors ever need to call this method.


resetProperties

public void resetProperties()
Clears all properties from the context. Not part of the RenderingContext interface.
Overrides:
resetProperties in class RenderedNodeRenderingContext

clone

public java.lang.Object clone()
Description copied from interface: RenderingContext
Returns a clone of the RenderingContext.
Overrides:
clone in class RenderedNodeRenderingContext

createErrorLog

protected ErrorLog createErrorLog()
Responsible for creating an error log for the rendering context. By default, creates an error log that will output to System.err.

createOutputMethod

protected OutputMethod createOutputMethod()
Responsible for creating an output method. The default implementation always throws an IllegalStateException. Users usually do not need to overwrite this method; instead they should call prepareOutput(PrintWriter,OutputStream,String,String)

createOutputMethod

protected OutputMethod createOutputMethod(java.io.PrintWriter outWriter,
                                          java.io.OutputStream stream,
                                          java.lang.String contentType,
                                          java.lang.String encoding)
                                   throws java.io.IOException
Responsible for creating an output method. The default implementation uses LookAndFeel.getOutputMethod(java.io.PrintWriter, java.io.OutputStream, java.lang.String, java.lang.String, oracle.cabo.share.error.ErrorLog). Users usually do not need to overwrite this method; instead they should call prepareOutput(PrintWriter,OutputStream,String,String)

getDefaultNodeStackSize

protected int getDefaultNodeStackSize()
Returns the default initial number of nodes in the stack of logical nodes.
Overrides:
getDefaultNodeStackSize in class RenderedNodeRenderingContext

getDefaultDataProviderSize

protected int getDefaultDataProviderSize()
Description copied from class: LogicalNodeRenderingContext
Returns the default initial number of DataProvider slots to allocate. Subclassers implementing RenderingContexts that may supportlarge numbers of DataProviders, should override this method to return a larger number.
Overrides:
getDefaultDataProviderSize in class LogicalNodeRenderingContext

getDefaultPropertyMapSize

protected int getDefaultPropertyMapSize()
Description copied from class: RenderedNodeRenderingContext
Returns the default size of the PropertyMap used to store properties on the RenderingContext.

The default for this property is relatively small.

Overrides:
getDefaultPropertyMapSize in class RenderedNodeRenderingContext

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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