SourceForge.net Logo

de.mindmatters.faces.spring.factory.config
Class UIComponentAutoProxyCreator

java.lang.Object
  extended byde.mindmatters.faces.spring.factory.config.UIComponentAutoProxyCreator
All Implemented Interfaces:
InstantiationProcessor

public final class UIComponentAutoProxyCreator
extends java.lang.Object
implements InstantiationProcessor

Creates a proxy for each Spring hosted and configured UIComponent.

The reason for proxying is the non-conformity of UIComponents to the JavaBeans conventions. More precisely, the following properties will be enhanced by this creator to gain JavaBeans conformity:

So this creator makes it possible to define and configure UIComponent trees in a declarative fashion in a "spring-beans.dtd" compatible config file.

Example XML context definition:

 <bean id="panelGroup" class="javax.faces.component.html.HtmlPanelGroup" singleton="false">
   <property name="children">
     <list>
       <bean class="javax.faces.component.html.HtmlOutputText" singleton="false">
         <property name="value" value="Hello Foo!"/>
       </bean>
       <bean class="javax.faces.component.html.HtmlOutputText" singleton="false">
         <property name="value" value="Hello Bar!"/>
       </bean>
     </list>
   </property>
 </bean>
 

Author:
Andreas Kuhrwahl

Nested Class Summary
static interface UIComponentAutoProxyCreator.UIComponentBuilder
          Interface that will be implemented by the UIComponent subclasses generated by the SubclassCreator.
 
Constructor Summary
UIComponentAutoProxyCreator()
           
 
Method Summary
 java.lang.Object processBeforeInstantiation(java.lang.Class beanClass, java.lang.String beanName, java.lang.reflect.Constructor ctor, java.lang.Object[] args)
          Applied before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean.

If a non-null object is returned by this method, the bean instantiation process will be short-circuited.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIComponentAutoProxyCreator

public UIComponentAutoProxyCreator()
Method Detail

processBeforeInstantiation

public java.lang.Object processBeforeInstantiation(java.lang.Class beanClass,
                                                   java.lang.String beanName,
                                                   java.lang.reflect.Constructor ctor,
                                                   java.lang.Object[] args)
Applied before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean.

If a non-null object is returned by this method, the bean instantiation process will be short-circuited.

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Specified by:
processBeforeInstantiation in interface InstantiationProcessor
Parameters:
beanClass - the class of the bean to be instantiated
beanName - the name of the bean
ctor - the constructor of the bean to be used for instantiation
args - the constructor arguments of the bean to be used for instantiation
Returns:
the bean object to expose or null when this instantiation processor is not responsible for instantiation

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG