com.sun.faces.config
Class ManagedBeanFactoryImpl

java.lang.Object
  extended by com.sun.faces.spi.ManagedBeanFactory
      extended by com.sun.faces.config.ManagedBeanFactoryImpl

public class ManagedBeanFactoryImpl
extends ManagedBeanFactory

This class creates a managed bean instance. It has a contract with the ManagedBeanBean class which is populated from the config file. The bean instance is created lazily so a deep copy of the ManagedBeanBean is required.

The Application implementation instantiated the beans as required and stores them in the appropriate scope.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.faces.spi.ManagedBeanFactory
ManagedBeanFactory.Scope
 
Constructor Summary
ManagedBeanFactoryImpl(ManagedBeanBean managedBean)
          Constructor
 
Method Summary
protected  java.lang.Class copyListEntriesFromConfigToList(ListEntriesBean listEntries, java.util.List<?> valuesForBean)
           
 java.lang.String getBeanDescription(java.lang.String lang)
           
protected  int getBeanType(java.lang.Object bean)
          determine the nature of the bean
 ManagedBeanBean getManagedBeanBean()
          Get the JavaBean that encapsulates the configuration data for the bean instance to be created by this factory.
 java.lang.Class getManagedBeanClass()
           
 java.util.Map<java.lang.String,ManagedBeanFactory> getManagedBeanFactoryMap()
          Get the Map of managed-bean-name to ManagedBeanFactory instances passed in a previous call to ManagedBeanFactory.setManagedBeanFactoryMap(java.util.Map).
protected  int getPropertyType(ManagedPropertyBean bean)
          determine the nature of the property
 ManagedBeanFactory.Scope getScope()
          Return the ManagedBeanFactory.Scope of the managed-bean created by this factory.
 boolean isInjectable()
           
static boolean isMixedVBExpression(java.lang.String expression)
           
static boolean isVBExpression(java.lang.String expression)
           
 java.lang.Object newInstance(javax.faces.context.FacesContext context)
          Attempt to instantiate the JavaBean and set its properties.
 void setComponentAttribute(java.lang.Object component, java.lang.String propName, java.lang.Object propValue)
          Sets the passed in property name and value as an attribute on UIComponent instance.
 void setManagedBeanBean(ManagedBeanBean newBean)
          Set the JavaBean that encapsulates the configuration data for the bean instance to be created by this factory.
 void setManagedBeanFactoryMap(java.util.Map<java.lang.String,ManagedBeanFactory> newManagedBeanFactoryMap)
          Set the Map of managed-bean-name to ManagedBeanFactory instances into this factory instance so that properties that are managed beans may be instantiated if necessary.
protected  void setPropertiesIntoBean(java.lang.Object bean, int beanType, ManagedBeanBean managedBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedBeanFactoryImpl

public ManagedBeanFactoryImpl(ManagedBeanBean managedBean)
Constructor

Method Detail

isInjectable

public boolean isInjectable()
Specified by:
isInjectable in class ManagedBeanFactory
Returns:
true if the managed bean instance created by this factory is a candidate for resource injection otherwise, returns false

setManagedBeanBean

public void setManagedBeanBean(ManagedBeanBean newBean)
Description copied from class: ManagedBeanFactory

Set the JavaBean that encapsulates the configuration data for the bean instance to be created by this factory.

Specified by:
setManagedBeanBean in class ManagedBeanFactory

getManagedBeanBean

public ManagedBeanBean getManagedBeanBean()
Description copied from class: ManagedBeanFactory

Get the JavaBean that encapsulates the configuration data for the bean instance to be created by this factory.

Specified by:
getManagedBeanBean in class ManagedBeanFactory

getManagedBeanFactoryMap

public java.util.Map<java.lang.String,ManagedBeanFactory> getManagedBeanFactoryMap()
Description copied from class: ManagedBeanFactory

Get the Map of managed-bean-name to ManagedBeanFactory instances passed in a previous call to ManagedBeanFactory.setManagedBeanFactoryMap(java.util.Map).

Note that this property enables the factory to know the complete set of configured managed-beans in this application.

Specified by:
getManagedBeanFactoryMap in class ManagedBeanFactory

setManagedBeanFactoryMap

public void setManagedBeanFactoryMap(java.util.Map<java.lang.String,ManagedBeanFactory> newManagedBeanFactoryMap)
Description copied from class: ManagedBeanFactory

Set the Map of managed-bean-name to ManagedBeanFactory instances into this factory instance so that properties that are managed beans may be instantiated if necessary.

Specified by:
setManagedBeanFactoryMap in class ManagedBeanFactory

getBeanDescription

public java.lang.String getBeanDescription(java.lang.String lang)

getManagedBeanClass

public final java.lang.Class getManagedBeanClass()

newInstance

public java.lang.Object newInstance(javax.faces.context.FacesContext context)
                             throws javax.faces.FacesException
Attempt to instantiate the JavaBean and set its properties.

Specified by:
newInstance in class ManagedBeanFactory
Throws:
javax.faces.FacesException

getBeanType

protected int getBeanType(java.lang.Object bean)
determine the nature of the bean

Returns:
the appropriate TYPE_IS_* constant

getPropertyType

protected int getPropertyType(ManagedPropertyBean bean)
determine the nature of the property

Returns:
the appropriate TYPE_IS_* constant

copyListEntriesFromConfigToList

protected java.lang.Class copyListEntriesFromConfigToList(ListEntriesBean listEntries,
                                                          java.util.List<?> valuesForBean)
                                                   throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

setPropertiesIntoBean

protected void setPropertiesIntoBean(java.lang.Object bean,
                                     int beanType,
                                     ManagedBeanBean managedBean)

getScope

public ManagedBeanFactory.Scope getScope()
Description copied from class: ManagedBeanFactory

Return the ManagedBeanFactory.Scope of the managed-bean created by this factory.

Specified by:
getScope in class ManagedBeanFactory

setComponentAttribute

public void setComponentAttribute(java.lang.Object component,
                                  java.lang.String propName,
                                  java.lang.Object propValue)
Sets the passed in property name and value as an attribute on UIComponent instance.


isVBExpression

public static boolean isVBExpression(java.lang.String expression)

isMixedVBExpression

public static boolean isMixedVBExpression(java.lang.String expression)


Copyright ? 2002-2006 Sun Microsystems, Inc. All Rights Reserved.