Class DynaActionFormClass

java.lang.Object
org.apache.struts.action.DynaActionFormClass
All Implemented Interfaces:
Serializable, org.apache.commons.beanutils.DynaClass

public class DynaActionFormClass extends Object implements org.apache.commons.beanutils.DynaClass, Serializable

Implementation of DynaClass for DynaActionForm classes that allow developers to define ActionForms without having to individually code all of the classes. NOTE - This class is only used in the internal implementation of dynamic action form beans. Application developers never need to consult this documentation.

Since:
Struts 1.1
Version:
$Rev$ $Date: 2006-01-17 07:26:20 -0500 (Tue, 17 Jan 2006) $
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Class<? extends DynaActionForm>
    The DynaActionForm implementation Class which we will use to create new bean instances.
    protected FormBeanConfig
    The form bean configuration information for this class.
    protected String
    The "dynamic class name" for this DynaClass.
    protected org.apache.commons.beanutils.DynaProperty[]
    The set of dynamic properties that are part of this DynaClass.
    protected HashMap<String,org.apache.commons.beanutils.DynaProperty>
    The set of dynamic properties that are part of this DynaClass, keyed by the property name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new DynaActionFormClass for the specified form bean configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the DynaActionFormClass instance for the specified form bean configuration instance.
    protected Class<? extends DynaActionForm>
    Return the implementation class we are using to construct new instances, re-introspecting our FormBeanConfig if necessary (that is, after being deserialized, since beanClass is marked transient).
    org.apache.commons.beanutils.DynaProperty[]
    Return an array of DynaPropertys for the properties currently defined in this DynaClass.
    org.apache.commons.beanutils.DynaProperty
    Return a property descriptor for the specified property, if it exists; otherwise, return null.
    Return the name of this DynaClass (analogous to the getName() method of java.lang.Class, which allows the same DynaClass implementation class to support different dynamic classes, with different sets of properties.
    protected void
    Introspect our form bean configuration to identify the supported properties.
    org.apache.commons.beanutils.DynaBean
    Instantiate and return a new DynaActionForm instance, associated with this DynaActionFormClass.
    Render a String representation of this object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • beanClass

      protected transient Class<? extends DynaActionForm> beanClass

      The DynaActionForm implementation Class which we will use to create new bean instances.

    • config

      protected FormBeanConfig config

      The form bean configuration information for this class.

    • name

      protected String name

      The "dynamic class name" for this DynaClass.

    • properties

      protected org.apache.commons.beanutils.DynaProperty[] properties

      The set of dynamic properties that are part of this DynaClass.

    • propertiesMap

      protected HashMap<String,org.apache.commons.beanutils.DynaProperty> propertiesMap

      The set of dynamic properties that are part of this DynaClass, keyed by the property name. Individual descriptor instances will be the same instances as those in the properties list.

  • Constructor Details

    • DynaActionFormClass

      public DynaActionFormClass(FormBeanConfig config)

      Construct a new DynaActionFormClass for the specified form bean configuration. This constructor is private; DynaActionFormClass instances will be created as needed via calls to the static createDynaActionFormClass() method.

      Parameters:
      config - The FormBeanConfig instance describing the properties of the bean to be created
      Throws:
      IllegalArgumentException - if the bean implementation class specified in the configuration is not DynaActionForm (or a subclass of DynaActionForm)
  • Method Details

    • getName

      public String getName()

      Return the name of this DynaClass (analogous to the getName() method of java.lang.Class, which allows the same DynaClass implementation class to support different dynamic classes, with different sets of properties.

      Specified by:
      getName in interface org.apache.commons.beanutils.DynaClass
      Returns:
      The name of this DynaClass.
    • getDynaProperty

      public org.apache.commons.beanutils.DynaProperty getDynaProperty(String name)

      Return a property descriptor for the specified property, if it exists; otherwise, return null.

      Specified by:
      getDynaProperty in interface org.apache.commons.beanutils.DynaClass
      Parameters:
      name - Name of the dynamic property for which a descriptor is requested
      Returns:
      A property descriptor for the specified property.
      Throws:
      IllegalArgumentException - if no property name is specified
    • getDynaProperties

      public org.apache.commons.beanutils.DynaProperty[] getDynaProperties()

      Return an array of DynaPropertys for the properties currently defined in this DynaClass. If no properties are defined, a zero-length array will be returned.

      Specified by:
      getDynaProperties in interface org.apache.commons.beanutils.DynaClass
      Returns:
      An array of property instances for this class.
    • newInstance

      public org.apache.commons.beanutils.DynaBean newInstance() throws IllegalAccessException, InstantiationException

      Instantiate and return a new DynaActionForm instance, associated with this DynaActionFormClass. The properties of the returned DynaActionForm will have been initialized to the default values specified in the form bean configuration information.

      Specified by:
      newInstance in interface org.apache.commons.beanutils.DynaClass
      Returns:
      A new DynaActionForm instance.
      Throws:
      IllegalAccessException - if the Class or the appropriate constructor is not accessible
      InstantiationException - if this Class represents an abstract class, an array class, a primitive type, or void; or if instantiation fails for some other reason
    • toString

      public String toString()

      Render a String representation of this object.

      Overrides:
      toString in class Object
      Returns:
      The string representation of this instance.
    • createDynaActionFormClass

      public static DynaActionFormClass createDynaActionFormClass(FormBeanConfig config)
      Return the DynaActionFormClass instance for the specified form bean configuration instance.
      Parameters:
      config - The config for which the class should be created.
      Returns:
      The instance for the specified form bean config.
    • getBeanClass

      protected Class<? extends DynaActionForm> getBeanClass()

      Return the implementation class we are using to construct new instances, re-introspecting our FormBeanConfig if necessary (that is, after being deserialized, since beanClass is marked transient).

      Returns:
      The implementation class used to construct new instances.
    • introspect

      protected void introspect(FormBeanConfig config)

      Introspect our form bean configuration to identify the supported properties.

      Parameters:
      config - The FormBeanConfig instance describing the properties of the bean to be created
      Throws:
      IllegalArgumentException - if the bean implementation class specified in the configuration is not DynaActionForm (or a subclass of DynaActionForm)