org.apache.struts.action
Class DynaActionFormClass
java.lang.Object
org.apache.struts.action.DynaActionFormClass
- DynaClass, Serializable
public class DynaActionFormClass
extends java.lang.Object
implements 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. Applications never need
to consult this documentation.
Version:
- Craig McClanahan
- Struts 1.1
protected Class | beanClass - The
DynaActionForm implementation Class which
we will use to create new bean instances.
|
protected FormBeanConfig | config - The form bean configuration information for this class.
|
protected static HashMap | dynaClasses - The set of
DynaActionFormClass instances that have
ever been created, keyed by the form bean name.
|
protected static String | lock - The lockable object we can synchronize on, even if dynaClasses
is null,
|
protected String | name - The "dynamic class name" for this
DynaClass .
|
protected DynaProperty[] | properties - The set of dynamic properties that are part of this DynaClass.
|
protected HashMap | propertiesMap - The set of dynamic properties that are part of this DynaClass,
keyed by the property name.
|
static void | clear() - Clear our cache of DynaActionFormClass instances.
|
static DynaActionFormClass | createDynaActionFormClass(FormBeanConfig config) - Create (if necessary) and return a new
DynaActionFormClass
instance for the specified form bean configuration instance.
|
protected Class | 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.
|
DynaProperty[] | getDynaProperties() - Return an array of
DynaProperty s for the properties
currently defined in this DynaClass.
|
DynaProperty | getDynaProperty(String name) - Return a property descriptor for the specified property, if it exists;
otherwise, return
null .
|
String | getName() - Return the name of this DynaClass (analogous to the
getName() method of java.lang.Class DynaClass implementation class to support
different dynamic classes, with different sets of properties.
|
protected void | introspect(FormBeanConfig config) - Introspect our form bean configuration to identify the supported
properties.
|
DynaBean | newInstance() - Instantiate and return a new
DynaActionForm instance,
associated with this DynaActionFormClass .
|
String | toString() - Render a String representation of this object.
|
beanClass
protected Class 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.
dynaClasses
protected static HashMap dynaClasses
The set of DynaActionFormClass
instances that have
ever been created, keyed by the form bean name.
lock
protected static String lock
The lockable object we can synchronize on, even if dynaClasses
is null,
name
protected String name
The "dynamic class name" for this DynaClass
.
properties
protected DynaProperty[] properties
The set of dynamic properties that are part of this DynaClass.
propertiesMap
protected HashMap 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.
DynaActionFormClass
private 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.
config
- The FormBeanConfig instance describing the properties
of the bean to be created
clear
public static void clear()
Clear our cache of DynaActionFormClass instances.
createDynaActionFormClass
public static DynaActionFormClass createDynaActionFormClass(FormBeanConfig config)
Create (if necessary) and return a new DynaActionFormClass
instance for the specified form bean configuration instance.
config
- The FormBeanConfig instance describing the properties
of the bean to be created
getBeanClass
protected Class 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.
getDynaProperties
public DynaProperty[] getDynaProperties()
Return an array of
DynaProperty
s for the properties
currently defined in this DynaClass. If no properties are defined, a
zero-length array will be returned.
FIXME - Should we really be implementing
getBeanInfo()
instead, which returns property descriptors
and a bunch of other stuff?
getDynaProperty
public DynaProperty getDynaProperty(String name)
Return a property descriptor for the specified property, if it exists;
otherwise, return null
.
name
- Name of the dynamic property for which a descriptor
is requested
getName
public String getName()
Return the name of this DynaClass (analogous to the
getName()
method of java.lang.Class
DynaClass
implementation class to support
different dynamic classes, with different sets of properties.
introspect
protected void introspect(FormBeanConfig config)
Introspect our form bean configuration to identify the supported
properties.
config
- The FormBeanConfig instance describing the properties
of the bean to be created
newInstance
public 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.
toString
public String toString()
Render a String representation of this object.
Copyright B) 2000-2005 - Apache Software Foundation