com.sun.rave.web.ui.renderer.template
Class LayoutDefinitionManager

java.lang.Object
  extended by com.sun.rave.web.ui.renderer.template.LayoutDefinitionManager
Direct Known Subclasses:
XMLLayoutDefinitionManager

public abstract class LayoutDefinitionManager
extends java.lang.Object

This abstract class provides the base functionality for all LayoutDefinitionManager implementations. It provides an static method used to obtain an instance of a concrete LayoutDefinitionManager: getManager(FacesContext). It also provides another version of this method which allows a specific instance to be specified by classname: getManager(String className) (typically not used, the environment should be setup to provide the correct LayoutDefinitionManager). Once an instance is obtained, the getLayoutDefinition(String key) method can be invoked to obtain a LayoutDefinition.


Field Summary
static java.lang.String DEFAULT_LAYOUT_DEFINITION_MANAGER_IMPL
          This constant defines the default layout definition manager implementation class name.
static java.lang.String LAYOUT_DEFINITION_MANAGER_KEY
          This constant defines the layout definition manager implementation key for initParams.
 
Constructor Summary
protected LayoutDefinitionManager()
          Constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
          Retrieve an attribute by key
abstract  LayoutDefinition getLayoutDefinition(java.lang.String key)
          This method is responsible for finding/creating the requested LayoutDefinition.
static LayoutDefinitionManager getManager(javax.faces.context.FacesContext context)
          This is a factory method for obtaining the LayoutDefinitionManager.
static LayoutDefinitionManager getManager(java.lang.String className)
          This method is a singleton factory method for obtaining an instance of a LayoutDefintionManager.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Associate the given key with the given Object as an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LAYOUT_DEFINITION_MANAGER_IMPL

public static final java.lang.String DEFAULT_LAYOUT_DEFINITION_MANAGER_IMPL
This constant defines the default layout definition manager implementation class name.

See Also:
Constant Field Values

LAYOUT_DEFINITION_MANAGER_KEY

public static final java.lang.String LAYOUT_DEFINITION_MANAGER_KEY
This constant defines the layout definition manager implementation key for initParams. ("layoutManagerImpl")

See Also:
Constant Field Values
Constructor Detail

LayoutDefinitionManager

protected LayoutDefinitionManager()
Constructor.

Method Detail

getLayoutDefinition

public abstract LayoutDefinition getLayoutDefinition(java.lang.String key)
This method is responsible for finding/creating the requested LayoutDefinition.

Parameters:
key - The key used to identify the requested LayoutDefintion

getManager

public static LayoutDefinitionManager getManager(javax.faces.context.FacesContext context)
This is a factory method for obtaining the LayoutDefinitionManager. This implementation uses the external context's initParams to look for the LayoutDefinitionManager class. If it exists, the specified concrete LayoutDefinitionManager class will be used. Otherwise, the default LayoutDefinitionManager will be used. The initParam key is: LAYOUT_DEFINITION_MANAGER_KEY.

Parameters:
context - The FacesContext
See Also:
LAYOUT_DEFINITION_MANAGER_KEY

getManager

public static LayoutDefinitionManager getManager(java.lang.String className)
This method is a singleton factory method for obtaining an instance of a LayoutDefintionManager. It is possible that multiple different implementations of LayoutDefinitionManagers will be used within the same JVM. This is OK, the purpose of the LayoutDefinitionManager is primarily performance. Someone may provide a different LayoutDefinitionManager to locate LayoutDefiniton's in a different way (XML, database, file, java code, etc.).


getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Retrieve an attribute by key

Parameters:
key - The key used to retrieve the attribute
Returns:
The requested attribute or null

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Associate the given key with the given Object as an attribute.

Parameters:
key - The key associated with the given object (if this key is already in use, it will replace the previously set attribute object).
value - The Object to store.