Class ApplicationBuilderData

  • All Implemented Interfaces:
    BuilderData

    public class ApplicationBuilderData
    extends Object
    implements BuilderData

    The application specific default implementation of the BuilderData interface.

    This class provides meaningful implementations of all methods required by the BuilderData interface. An instance can be obtained from the ApplicationContext class that is already initialized with predefined values for many fields. So a client need not bother with all of the data supported by this interface, but has only to set the values it is specially interested in.

    Implementation note: this class is not thread-safe. The typical usage scenario is that an instance is requested from ApplicationContext, initialized with the properties required by the application and passed to a builder.

    Version:
    $Id: ApplicationBuilderData.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    See Also:
    ApplicationContext.initBuilderData()
    • Constructor Detail

      • ApplicationBuilderData

        public ApplicationBuilderData()
        Creates a new instance of ApplicationBuilderData.
    • Method Detail

      • setActionStore

        public void setActionStore​(ActionStore actionStore)
        Sets the action store.
        Parameters:
        actionStore - the actionStore
      • getDefaultResourceGroup

        public Object getDefaultResourceGroup()
        Returns the default resource group.
        Specified by:
        getDefaultResourceGroup in interface BuilderData
        Returns:
        the default resource group
      • setDefaultResourceGroup

        public void setDefaultResourceGroup​(Object defaultResourceGroup)
        Sets the default resource group.
        Parameters:
        defaultResourceGroup - the default resource group
      • getFormBean

        public Object getFormBean()
        Returns the form bean.
        Specified by:
        getFormBean in interface BuilderData
        Returns:
        the form bean
      • setFormBean

        public void setFormBean​(Object formBean)
        Sets the form bean.
        Parameters:
        formBean - the form bean
      • setBindingStrategy

        public void setBindingStrategy​(BindingStrategy strat)
        Sets the BindingStrategy to be used by the current form.
        Parameters:
        strat - the BindingStrategy
      • getFormValidator

        public FormValidator getFormValidator()
        Returns the FormValidator for validating the current form.
        Specified by:
        getFormValidator in interface BuilderData
        Returns:
        the FormValidator
      • setFormValidator

        public void setFormValidator​(FormValidator validator)
        Sets the FormValidator for validating the current form. If no FormValidator is set, no form-level validation is performed. The form's fields may be validated though if corresponding validators have been defined.
        Parameters:
        validator - the FormValidator
      • isMenuIcon

        public boolean isMenuIcon()
        Returns the menu icon flag.
        Specified by:
        isMenuIcon in interface BuilderData
        Returns:
        the menu icon flag
      • setMenuIcon

        public void setMenuIcon​(boolean menuIcon)
        Sets the menu icon flag.
        Parameters:
        menuIcon - the flag value
      • getParentWindow

        public Window getParentWindow()
        Returns the parent window.
        Specified by:
        getParentWindow in interface BuilderData
        Returns:
        the parent window
      • setParentWindow

        public void setParentWindow​(Window parentWindow)
        Sets the parent window.
        Parameters:
        parentWindow - the parent window
      • isToolbarText

        public boolean isToolbarText()
        Returns the toolbar text flag.
        Specified by:
        isToolbarText in interface BuilderData
        Returns:
        the toolbar text flag
      • setToolbarText

        public void setToolbarText​(boolean toolbarText)
        Sets the toolbar text flag.
        Parameters:
        toolbarText - the toolbar text flag
      • setTransformerContext

        public void setTransformerContext​(TransformerContext transformerContext)
        Sets the transformer context.
        Parameters:
        transformerContext - the transformer context
      • setBeanBuilderResult

        public void setBeanBuilderResult​(BeanBuilderResult res)
        Sets the result object for the bean builder.
        Specified by:
        setBeanBuilderResult in interface BuilderData
        Parameters:
        res - the results of the bean builder
      • setParentContext

        public void setParentContext​(BeanContext ctx)
        Sets the parent bean context.
        Parameters:
        ctx - the parent bean context
      • getBuilderContext

        public BeanContext getBuilderContext()
        Returns the bean context used by the builder.
        Specified by:
        getBuilderContext in interface BuilderData
        Returns:
        the builder's bean context
      • setBuilderContext

        public void setBuilderContext​(BeanContext ctx)
        Sets the bean context used by the builder.
        Specified by:
        setBuilderContext in interface BuilderData
        Parameters:
        ctx - the builder's bean context
      • setInvocationHelper

        public void setInvocationHelper​(InvocationHelper invocationHelper)
        Sets the InvocationHelper.
        Parameters:
        invocationHelper - the InvocationHelper
      • setMessageOutput

        public void setMessageOutput​(MessageOutput messageOutput)
        Sets the MessageOutput object.
        Parameters:
        messageOutput - the message output object
      • setCommandQueue

        public void setCommandQueue​(CommandQueue commandQueue)
        Sets the CommandQueue.
        Parameters:
        commandQueue - the command queue
      • getBeanCreationListeners

        public Collection<BeanCreationListener> getBeanCreationListeners()
        Returns a collection with BeanCreationListener objects to be registered at the BeanContext created by the builder. Note: this collection cannot be modified.
        Specified by:
        getBeanCreationListeners in interface BuilderData
        Returns:
        a collection with BeanCreationListener objects
      • addBeanCreationListener

        public void addBeanCreationListener​(BeanCreationListener l)
        Adds the specified BeanCreationListener to this object. It will be registered at the BeanContext created by the builder and thus notified for all bean created by the dependency injection framework.
        Parameters:
        l - the BeanCreationListener to be added (must not be null)
        Throws:
        IllegalArgumentException - if the BeanCreationListener is null
      • addBeanCreationListeners

        public void addBeanCreationListeners​(Collection<? extends BeanCreationListener> listeners)
        Adds all BeanCreationListener objects contained in the given collection to this object. They will be registered at the BeanContext created by the builder and thus notified for all bean created by the dependency injection framework.
        Parameters:
        listeners - the collection with BeanCreationListener objects (must not be null)
        Throws:
        IllegalArgumentException - if the collection is null or contains null elements
      • getBuilder

        public Builder getBuilder()
        Returns a reference to the Builder instance that processed this object. This value is available only after the Builder was called.
        Specified by:
        getBuilder in interface BuilderData
        Returns:
        the Builder that processed this BuilderData object
      • setBuilder

        public void setBuilder​(Builder builder)
        Sets the Builder that processed this object. This method is called by the Builder instance during the builder operation.
        Specified by:
        setBuilder in interface BuilderData
        Parameters:
        builder - the Builder
      • getBuilderName

        public String getBuilderName()
        Returns the name of the builder.
        Specified by:
        getBuilderName in interface BuilderData
        Returns:
        the name of the builder
      • setBuilderName

        public void setBuilderName​(String builderName)
        Sets a name for the builder. This name is available during the build process (through the ComponentBuilderData object). It can be used for conditional execution of builder scripts.
        Parameters:
        builderName - the name of the builder
      • isAutoRelease

        public boolean isAutoRelease()
        Returns the auto release flag.
        Specified by:
        isAutoRelease in interface BuilderData
        Returns:
        the auto release flag
      • setAutoRelease

        public void setAutoRelease​(boolean autoRelease)
        Sets the auto release flag. This flag is evaluated if a window is generated during the builder operation. A value of true means that this object and all resources referenced by it should be freed automatically when the window is closed. This is done by invoking Builder.release(BuilderData) on the Builder responsible. Note that the default value of this flag is true, so auto release is enabled per default.
        Parameters:
        autoRelease - the value of the auto release flag
      • getProperties

        public Map<String,​Object> getProperties()
        Returns a map with additional properties for the builder operation. This implementation either returns the map set by setProperties(Map) or the one that was created automatically when #addProperty() was called. Result may also be null if no properties have been set.
        Specified by:
        getProperties in interface BuilderData
        Returns:
        a map with additional properties for the builder operation
        See Also:
        setProperties(Map), addProperty(String, Object)
      • setProperties

        public void setProperties​(Map<String,​Object> props)
        Sets additional properties for the builder operation. The map passed to this method is directly stored and passed to the builder.
        Parameters:
        props - the map with additional properties
      • addProperty

        public void addProperty​(String key,
                                Object value)
        Adds an additional property for the builder operation. This method can be used to populate the map with additional properties that is returned by getProperties(). If no map with properties has been set yet, a new one is created (getProperties() will return this new map). Otherwise, the property is added to the existing map.
        Parameters:
        key - the key of the property
        value - the value of the property