Package: groovy.swing.factory

## [Groovy] Class BeanFactory

- groovy.swing.factory.BeanFactory

-     class BeanFactory
      extends AbstractFactory

  Since:
    Groovy 1.1

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected boolean` | `leaf` | Whether created nodes are treated as leaves.

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Class` | `beanClass` Bean type instantiated by this factory.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `BeanFactory(Class beanClass)` Creates a new base factory that instantiates bean types for SwingBuilder
    `BeanFactory(Class beanClass, boolean leaf)` Creates a new base factory that instantiates bean types for SwingBuilder

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `isLeaf()` Indicates whether nodes created by this factory accept children.
    `` | `Object` | `newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)` Creates the node handled by this factory.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractFactory` | `isHandlesNodeChildren, isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeChildren, onNodeCompleted, setChild, setParent`

- - ### Field Detail

    - #### protected final boolean leaf

      Whether created nodes are treated as leaves.

  - ### Property Detail

    - #### final Class beanClass

      Bean type instantiated by this factory.

  - ### Constructor Detail

    - #### BeanFactory(Class beanClass)

      Creates a new base factory that instantiates bean types for SwingBuilder

      Parameters:
        `beanClass` - the bean type created by this factory

    - #### BeanFactory(Class beanClass, boolean leaf)

      Creates a new base factory that instantiates bean types for SwingBuilder

      Parameters:
        `beanClass` - the bean type created by this factory
        `leaf` - whether created nodes are leaf nodes

  - ### Method Detail

    - #### boolean isLeaf()

      Indicates whether nodes created by this factory accept children.

      Returns:
        true if child nodes are not expected

    - #### Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)

      Creates the node handled by this factory.

      Parameters:
        `builder` - the factory builder
        `name` - the node name
        `value` - the node value
        `attributes` - the node attributes
      Returns:
        the created or reused node