org.ow2.opensuit.xml.spring
Class SpringBeans

java.lang.Object
  extended by org.ow2.opensuit.xml.spring.SpringBeans
All Implemented Interfaces:
org.ow2.opensuit.xml.base.binding.IDataSource, org.ow2.opensuit.xml.interfaces.IBeanProvider, org.ow2.opensuit.xmlmap.interfaces.IInitializable

@XmlElement
public class SpringBeans
extends java.lang.Object
implements org.ow2.opensuit.xml.base.binding.IDataSource, org.ow2.opensuit.xmlmap.interfaces.IInitializable

This class allows to use :

Version:
1.0
Author:
Adrien Ruffie / Pierre Smeyers, http://opensuit.ow2.org/

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.opensuit.xml.interfaces.IBeanProvider
org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError
 
Constructor Summary
SpringBeans()
           
 
Method Summary
 java.lang.reflect.Type getBeanGenericType(java.lang.String name)
          Research method called in order to find the Type, of the asked bean name provided in function parameter.
 java.lang.Class<?> getBeanType(java.lang.String name)
          Research method called in order to find the type (wrapped in form of Class
 java.lang.Object getBeanValue(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Method called in order to retrieve the associated value for the asked bean name provided in function parameter.
 void initialize(org.ow2.opensuit.xmlmap.interfaces.IInitializationSupport initSupport, org.ow2.opensuit.xmlmap.interfaces.IInstantiationContext instContext)
          Initialization method called after instantiation, in order to perform initialize attributes and validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringBeans

public SpringBeans()
Method Detail

initialize

public void initialize(org.ow2.opensuit.xmlmap.interfaces.IInitializationSupport initSupport,
                       org.ow2.opensuit.xmlmap.interfaces.IInstantiationContext instContext)
Initialization method called after instantiation, in order to perform initialize attributes and validation.

Specified by:
initialize in interface org.ow2.opensuit.xmlmap.interfaces.IInitializable
Parameters:
initSupport - IInitializationSupport interface allows to log validation errors, and trigger dependent objects initialization
instContext - IInstantiationContext interface allows to instantiate an XML document with external context (providing external ancestors)
See Also:
IInitializable.initialize(IInitializationSupport, IInstantiationContext)

getBeanType

public java.lang.Class<?> getBeanType(java.lang.String name)
                               throws org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError
Research method called in order to find the type (wrapped in form of Class, of the asked bean name provided in function parameter. Can return null if the bean isn't exist.

Specified by:
getBeanType in interface org.ow2.opensuit.xml.interfaces.IBeanProvider
Parameters:
name - Represent the called bean name in Spring Context
Returns:
Class return the type (wrapped in Class object) of asked bean
Throws:
UnresolvedBeanError - this means that the bean resolution failed
org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError
See Also:
IBeanProvider.getBeanType(String)

getBeanGenericType

public java.lang.reflect.Type getBeanGenericType(java.lang.String name)
                                          throws org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError
Research method called in order to find the Type, of the asked bean name provided in function parameter. Can return null if the bean isn't exist. Unlike getBeanType method, getBeanGenericType return the bean Type unwrapped (not return Class but Type)

Specified by:
getBeanGenericType in interface org.ow2.opensuit.xml.interfaces.IBeanProvider
Parameters:
name - Represent the called bean name in Spring Context
Returns:
Type return the Type of asked bean
Throws:
UnresolvedBeanError - this means that the bean resolution failed
org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError
See Also:
IBeanProvider.getBeanGenericType(String)

getBeanValue

public java.lang.Object getBeanValue(javax.servlet.http.HttpServletRequest request,
                                     java.lang.String name)
                              throws java.lang.Exception
Method called in order to retrieve the associated value for the asked bean name provided in function parameter. Can return null if the bean isn't exist.

Specified by:
getBeanValue in interface org.ow2.opensuit.xml.interfaces.IBeanProvider
Parameters:
request - Unused parameter
name - Represent the called bean name in Spring Context
Returns:
Object return the value of asked bean wrapped in Object instance, because bean value can be of any type like Integer, String, DataSource ...
Throws:
java.lang.Exception - Can throws several types of exception, but one specifically can be throw 'InvocationTargetException'.
See Also:
IBeanProvider.getBeanValue(HttpServletRequest, String)


Copyright © 2008-2010 eBMWebsourcing. All Rights Reserved.