org.springframework.richclient.application.support
Class BeanFactoryViewDescriptorRegistry

Show UML class diagram
java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.richclient.application.support.BeanFactoryViewDescriptorRegistry
All Implemented Interfaces:
ApplicationContextAware, ViewDescriptorRegistry

public class BeanFactoryViewDescriptorRegistry
extends ApplicationObjectSupport
implements ViewDescriptorRegistry

A simple ViewDescriptorRegistry implementation that pulls singleton view definitions out of a spring application context. This class is intended to be managed by a Spring IoC container. If being created programatically, be sure to call the ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) method.

Author:
Keith Donald, Kevin Stembridge

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
BeanFactoryViewDescriptorRegistry()
           
 
Method Summary
 ViewDescriptor getViewDescriptor(String viewName)
          Returns the view descriptor with the given identifier, or null if no such bean definition with the given name exists in the current application context.
 ViewDescriptor[] getViewDescriptors()
          Returns an array of all the view descriptors in the registry.
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanFactoryViewDescriptorRegistry

public BeanFactoryViewDescriptorRegistry()
Method Detail

getViewDescriptors

public ViewDescriptor[] getViewDescriptors()
Returns an array of all the view descriptors in the registry.

Specified by:
getViewDescriptors in interface ViewDescriptorRegistry
Returns:
An array of all the view descriptors in the registry. The array may be empty but will never be null.

getViewDescriptor

public ViewDescriptor getViewDescriptor(String viewName)
Returns the view descriptor with the given identifier, or null if no such bean definition with the given name exists in the current application context.

Specified by:
getViewDescriptor in interface ViewDescriptorRegistry
Parameters:
viewName - The bean name of the view descriptor that is to be retrieved from the underlying application context. Must not be null.
Returns:
The view descriptor with the given id, or null.
Throws:
IllegalArgumentException - if viewName is null.
BeanNotOfRequiredTypeException - if the bean retrieved from the underlying application context is not of type ViewDescriptor.


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.