Class JellyContextBeanStore
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.impl.JellyContextBeanStore
-
- All Implemented Interfaces:
BeanStore
public class JellyContextBeanStore extends Object implements BeanStore
A specialized implementation of the
BeanStore
interface that is backed by a Jelly context.This class provides access to the variables stored in a Jelly context through the methods defined by the
BeanStore
interface. This way a Jelly context (e.g. initialized by a builder operation) can transparently be used by the dependency injection framework.- Version:
- $Id: JellyContextBeanStore.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description JellyContextBeanStore(org.apache.commons.jelly.JellyContext ctx, BeanStore parentStore)
Creates a new instance ofJellyContextBeanStore
and initializes it with the underlying Jelly context and the parent bean store.JellyContextBeanStore(org.apache.commons.jelly.JellyContext ctx, BeanStore parentStore, String storeName)
Creates a new instance ofJellyContextBeanStore
and initializes it with the underlying Jelly context, the parent bean store and the name to be used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanProvider
getBeanProvider(String name)
Returns aBeanProvider
for accessing the bean with the given name.org.apache.commons.jelly.JellyContext
getContext()
Returns the underlying Jelly context.ConversionHelper
getConversionHelper()
Returns theConversionHelper
used by this bean store.String
getName()
Returns the name of this bean store.BeanStore
getParent()
Returns the parent bean store.Set<String>
providerNames()
Returns a set with the names of the existingBeanProvider
s.
-
-
-
Constructor Detail
-
JellyContextBeanStore
public JellyContextBeanStore(org.apache.commons.jelly.JellyContext ctx, BeanStore parentStore, String storeName)
Creates a new instance ofJellyContextBeanStore
and initializes it with the underlying Jelly context, the parent bean store and the name to be used.- Parameters:
ctx
- the Jelly context (must not be null)parentStore
- the parent storestoreName
- the name- Throws:
IllegalArgumentException
- if the passed in Jelly context is null
-
JellyContextBeanStore
public JellyContextBeanStore(org.apache.commons.jelly.JellyContext ctx, BeanStore parentStore)
Creates a new instance ofJellyContextBeanStore
and initializes it with the underlying Jelly context and the parent bean store. For the name a default value is used.- Parameters:
ctx
- the Jelly context (must not be null)parentStore
- the parent store
-
-
Method Detail
-
getContext
public org.apache.commons.jelly.JellyContext getContext()
Returns the underlying Jelly context.- Returns:
- the Jelly context
-
getBeanProvider
public BeanProvider getBeanProvider(String name)
Returns aBeanProvider
for accessing the bean with the given name. This implementation checks whether the Jelly context contains a variable with the given name. If this is the case, a bean provider serving this value is returned. Otherwise the result of this method is null.- Specified by:
getBeanProvider
in interfaceBeanStore
- Parameters:
name
- the name of the desired bean- Returns:
- a
BeanProvider
for this bean
-
getName
public String getName()
Returns the name of this bean store.
-
getParent
public BeanStore getParent()
Returns the parent bean store.
-
providerNames
public Set<String> providerNames()
Returns a set with the names of the existingBeanProvider
s. This implementation returns a set with the names of the variables defined in the underlying Jelly context.- Specified by:
providerNames
in interfaceBeanStore
- Returns:
- a set with the names of the known bean providers
-
getConversionHelper
public ConversionHelper getConversionHelper()
Returns theConversionHelper
used by this bean store. This implementation always returns null.- Specified by:
getConversionHelper
in interfaceBeanStore
- Returns:
- the
ConversionHelper
-
-