Class DynaActionFormClass
- All Implemented Interfaces:
Serializable,DynaClass
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
FieldsModifier and TypeFieldDescriptionprotected Class<? extends DynaActionForm> TheDynaActionFormimplementationClasswhich we will use to create new bean instances.protected FormBeanConfigThe form bean configuration information for this class.protected StringThe "dynamic class name" for thisDynaClass.protected DynaProperty[]The set of dynamic properties that are part of this DynaClass.protected HashMap<String, DynaProperty> The set of dynamic properties that are part of thisDynaClass, keyed by the property name. -
Constructor Summary
ConstructorsConstructorDescriptionDynaActionFormClass(FormBeanConfig config) Construct a newDynaActionFormClassfor the specified form bean configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic DynaActionFormClassReturn theDynaActionFormClassinstance for the specified form bean configuration instance.protected Class<? extends DynaActionForm> Return the implementation class we are using to construct new instances, re-introspecting ourFormBeanConfigif necessary (that is, after being deserialized, sincebeanClassis marked transient).Return an array ofDynaPropertys for the properties currently defined in thisDynaClass.getDynaProperty(String name) Return a property descriptor for the specified property, if it exists; otherwise, returnnull.getName()Return the name of thisDynaClass(analogous to thegetName()method ofjava.lang.Class, which allows the sameDynaClassimplementation class to support different dynamic classes, with different sets of properties.protected voidintrospect(FormBeanConfig config) Introspect our form bean configuration to identify the supported properties.Instantiate and return a newDynaActionForminstance, associated with thisDynaActionFormClass.toString()Render aStringrepresentation of this object.
-
Field Details
-
beanClass
The
DynaActionFormimplementationClasswhich we will use to create new bean instances. -
config
The form bean configuration information for this class.
-
name
The "dynamic class name" for this
DynaClass. -
properties
The set of dynamic properties that are part of this DynaClass.
-
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 thepropertieslist.
-
-
Constructor Details
-
DynaActionFormClass
Construct a new
DynaActionFormClassfor the specified form bean configuration. This constructor is private;DynaActionFormClassinstances will be created as needed via calls to the staticcreateDynaActionFormClass()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
Return the name of this
DynaClass(analogous to thegetName()method ofjava.lang.Class, which allows the sameDynaClassimplementation class to support different dynamic classes, with different sets of properties. -
getDynaProperty
Return a property descriptor for the specified property, if it exists; otherwise, return
null.- Specified by:
getDynaPropertyin interfaceDynaClass- 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
Return an array of
DynaPropertys for the properties currently defined in thisDynaClass. If no properties are defined, a zero-length array will be returned.- Specified by:
getDynaPropertiesin interfaceDynaClass- Returns:
- An array of property instances for this class.
-
newInstance
Instantiate and return a new
DynaActionForminstance, associated with thisDynaActionFormClass. The properties of the returnedDynaActionFormwill have been initialized to the default values specified in the form bean configuration information.- Specified by:
newInstancein interfaceDynaClass- Returns:
- A new
DynaActionForminstance. - Throws:
IllegalAccessException- if the Class or the appropriate constructor is not accessibleInstantiationException- if this Class represents an abstract class, an array class, a primitive type, or void; or if instantiation fails for some other reason
-
toString
Render a
Stringrepresentation of this object. -
createDynaActionFormClass
Return theDynaActionFormClassinstance 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
Return the implementation class we are using to construct new instances, re-introspecting our
FormBeanConfigif necessary (that is, after being deserialized, sincebeanClassis marked transient).- Returns:
- The implementation class used to construct new instances.
-
introspect
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)
-