Package net.sf.jguiraffe.gui.builder
Interface BeanBuilder
-
- All Known Implementing Classes:
JellyBeanBuilder
,JellyBuilder
public interface BeanBuilder
Definition of an interface for processing scripts with bean definitions.
A bean builder is able to create and populate
BeanStore
objects to be used by the dependency injection framework. After a successful build operation the defined beans can be easily accessed.This interface is pretty lean. It defines methods for executing a script with bean definitions. The return value is a data object, from which the initialized
BeanStore
instances can be queried. Another method can be called to free all resources used by produced beans. This method should be called if the builder results are no longer needed.For obtaining concrete implementations of this interface, usually a
BeanBuilderFactory
is used.- Version:
- $Id: BeanBuilder.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BeanBuilderResult
build(Locator script, MutableBeanStore rootStore, ClassLoaderProvider loaderProvider)
Executes a script with bean definitions.BeanBuilderResult
build(Locator script, MutableBeanStore rootStore, ClassLoaderProvider loaderProvider, InvocationHelper invHlp)
Executes a script with bean definitions and the specified helper objects.void
release(BeanBuilderResult result)
Releases the specifiedBeanBuilderResult
object.
-
-
-
Method Detail
-
build
BeanBuilderResult build(Locator script, MutableBeanStore rootStore, ClassLoaderProvider loaderProvider) throws BuilderException
Executes a script with bean definitions.- Parameters:
script
- points to the script to be executed (must not be null)rootStore
- the rootBeanStore
object; if defined, the processed bean definitions will be added to this store unless otherwise specified; if null, a new bean store will be createdloaderProvider
- an object with information about registered class loaders; can be null, then a default class loader provider will be used- Returns:
- an object providing access to the
BeanStore
instances created or populated during the builder operation - Throws:
BuilderException
- if an error occursIllegalArgumentException
- if the script is null
-
build
BeanBuilderResult build(Locator script, MutableBeanStore rootStore, ClassLoaderProvider loaderProvider, InvocationHelper invHlp) throws BuilderException
Executes a script with bean definitions and the specified helper objects. With this method all helper objects taking part in the builder operation can be specified. Passing theInvocationHelper
can be useful if the script defines special beans which require custom data type converters. These converters can be configured in theConversionHelper
instance contained in theInvocationHelper
. It is possible to pass null references for the helper objects. In this case default objects are created.- Parameters:
script
- points to the script to be executed (must not be null)rootStore
- the rootBeanStore
object; if defined, the processed bean definitions will be added to this store unless otherwise specified; if null, a new bean store will be createdloaderProvider
- an object with information about registered class loaders; can be null, then a default class loader provider will be usedinvHlp
- a helper object for reflection operations; can be null, then a default helper object will be used- Returns:
- an object providing access to the
BeanStore
instances created or populated during the builder operation - Throws:
BuilderException
- if an error occursIllegalArgumentException
- if the script is null
-
release
void release(BeanBuilderResult result)
Releases the specifiedBeanBuilderResult
object. This frees all resources associated with that data object. Especially on allBeanProvider
objects found in one of theBeanStore
s referenced by theBeanBuilderResult
object theshutdown()
method is called. When the data produced by aBeanBuilder
is no more needed clients should invoke this method to ensure a proper clean up.- Parameters:
result
- theBeanBuilderResult
object to be released (must not be null)- Throws:
IllegalArgumentException
- if the data object is null
-
-