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 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
 String getBeanDescription(String name)
           
 Type getBeanGenericType(String name)
          Research method called in order to find the Type, of the asked bean name provided in function parameter.
 List<String> getBeanNames()
           
 Class<?> getBeanType(String name)
          Research method called in order to find the type (wrapped in form of Class
 Object getBeanValue(javax.servlet.http.HttpServletRequest request, 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 Class<?> getBeanType(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:
org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError - this means that the bean resolution failed
See Also:
IBeanProvider.getBeanType(String)

getBeanGenericType

public Type getBeanGenericType(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:
org.ow2.opensuit.xml.interfaces.IBeanProvider.UnresolvedBeanError - this means that the bean resolution failed
See Also:
IBeanProvider.getBeanGenericType(String)

getBeanValue

public Object getBeanValue(javax.servlet.http.HttpServletRequest request,
                           String name)
                    throws 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:
Exception - Can throws several types of exception, but one specifically can be throw 'InvocationTargetException'.
See Also:
IBeanProvider.getBeanValue(HttpServletRequest, String)

getBeanNames

public List<String> getBeanNames()
Specified by:
getBeanNames in interface org.ow2.opensuit.xml.interfaces.IBeanProvider

getBeanDescription

public String getBeanDescription(String name)
Specified by:
getBeanDescription in interface org.ow2.opensuit.xml.interfaces.IBeanProvider


Copyright © 2008-2012 OW2 Consortium. All Rights Reserved.