| java.lang.Object org.apache.struts.config.BaseConfig org.apache.struts.config.FormBeanConfig
All known Subclasses: org.apache.struts.webapp.examples.CustomFormBean, org.apache.struts.action.ActionFormBean,
FormBeanConfig | public class FormBeanConfig extends BaseConfig (Code) | | A JavaBean representing the configuration information of a
<form-bean> element in a Struts configuration file.
version: $Rev: 472728 $ $Date: 2006-01-17 07:26:20 -0500 (Tue, 17 Jan 2006) version: $ since: Struts 1.1 |
Field Summary | |
protected transient DynaActionFormClass | dynaActionFormClass The DynaActionFormClass associated with a DynaActionForm. | protected boolean | dynamic | protected boolean | extensionProcessed | protected HashMap | formProperties The set of FormProperty elements defining dynamic form properties for
this form bean, keyed by property name. | protected String | inherit The name of the FormBeanConfig that this config inherits configuration
information from. | protected String | lock | protected String | name The unique identifier of this form bean, which is used to reference
this bean in ActionMapping instances as well as for the
name of the request or session attribute under which the corresponding
form bean instance is created or accessed. | protected boolean | restricted Is this DynaClass currently restricted (for DynaBeans with a
MutableDynaClass). | protected String | type The fully qualified Java class name of the implementation class to be
used or generated. |
dynaActionFormClass | protected transient DynaActionFormClass dynaActionFormClass(Code) | | The DynaActionFormClass associated with a DynaActionForm.
|
dynamic | protected boolean dynamic(Code) | | Is the form bean class an instance of DynaActionForm with dynamic
properties?
|
extensionProcessed | protected boolean extensionProcessed(Code) | | Have the inheritance values for this class been applied?
|
formProperties | protected HashMap formProperties(Code) | | The set of FormProperty elements defining dynamic form properties for
this form bean, keyed by property name.
|
inherit | protected String inherit(Code) | | The name of the FormBeanConfig that this config inherits configuration
information from.
|
lock | protected String lock(Code) | | The lockable object we can synchronize on when creating
DynaActionFormClass.
|
name | protected String name(Code) | | The unique identifier of this form bean, which is used to reference
this bean in ActionMapping instances as well as for the
name of the request or session attribute under which the corresponding
form bean instance is created or accessed.
|
restricted | protected boolean restricted(Code) | | Is this DynaClass currently restricted (for DynaBeans with a
MutableDynaClass).
|
type | protected String type(Code) | | The fully qualified Java class name of the implementation class to be
used or generated.
|
addFormPropertyConfig | public void addFormPropertyConfig(FormPropertyConfig config)(Code) | | Add a new FormPropertyConfig instance to the set
associated with this module.
Parameters: config - The new configuration instance to be added throws: IllegalArgumentException - if this property name has already beendefined |
canReuse | public boolean canReuse(ActionForm form)(Code) | | Checks if the given ActionForm instance is suitable for
use as an alternative to calling this FormBeanConfig
instance's createActionForm method.
Parameters: form - an existing form instance that may be reused. true if the given form can be reused as the form for thisconfig. |
checkCircularInheritance | protected boolean checkCircularInheritance(ModuleConfig moduleConfig)(Code) | | Traces the hierarchy of this object to check if any of the ancestors
is extending this instance.
Parameters: moduleConfig - The configuration for the module being configured. true if circular inheritance was detected. |
createActionForm | public ActionForm createActionForm(ActionServlet servlet) throws IllegalAccessException, InstantiationException(Code) | | Create and return an ActionForm instance appropriate to
the information in this FormBeanConfig .
Although this method is not formally deprecated yet, where possible,
the form which accepts an ActionContext as an argument is
preferred, to help sever direct dependencies on the Servlet API. As
the ActionContext becomes more familiar in Struts, this method will
almost certainly be deprecated.
Parameters: servlet - The action servlet ActionForm instance throws: IllegalAccessException - if the Class or the appropriateconstructor is not accessible throws: InstantiationException - if this Class represents an abstractclass, an array class, a primitive type,or void; or if instantiation fails forsome other reason |
createActionForm | public ActionForm createActionForm(ActionContext context) throws IllegalAccessException, InstantiationException(Code) | | Create and return an ActionForm instance appropriate to
the information in this FormBeanConfig .
NOTE: If the given ActionContext is not of type
ServletActionContext (or a subclass), then the form which
is returned will have a null servlet property. Some of
the subclasses of ActionForm included in Struts will later
throw a NullPointerException in this case. TODO:
Find a way to control this direct dependency on the Servlet API.
Parameters: context - The ActionContext. ActionForm instance throws: IllegalAccessException - if the Class or the appropriateconstructor is not accessible throws: InstantiationException - if this Class represents an abstractclass, an array class, a primitive type,or void; or if instantiation fails forsome other reason |
findFormPropertyConfig | public FormPropertyConfig findFormPropertyConfig(String name)(Code) | | Return the form property configuration for the specified property name,
if any; otherwise return null .
Parameters: name - Form property name to find a configuration for |
findFormPropertyConfigs | public FormPropertyConfig[] findFormPropertyConfigs()(Code) | | Return the form property configurations for this module. If there are
none, a zero-length array is returned.
|
formBeanClass | protected Class formBeanClass()(Code) | | Return the Class instance for the form bean implementation
configured by this FormBeanConfig instance. This method
uses the same algorithm as RequestUtils.applicationClass()
but is reproduced to avoid a runtime dependence.
|
freeze | public void freeze()(Code) | | Freeze the configuration of this component.
|
getDynamic | public boolean getDynamic()(Code) | | |
inheritFrom | public void inheritFrom(FormBeanConfig config) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException(Code) | | Inherit values that have not been overridden from the provided
config object. Subclasses overriding this method should verify that
the given parameter is of a class that contains a property it is trying
to inherit:
if (config instanceof MyCustomConfig) {
MyCustomConfig myConfig =
(MyCustomConfig) config;
if (getMyCustomProp() == null) {
setMyCustomProp(myConfig.getMyCustomProp());
}
}
If the given config is extending another object, those
extensions should be resolved before it's used as a parameter to this
method.
Parameters: config - The object that this instance will be inheriting itsvalues from. See Also: FormBeanConfig.processExtends(ModuleConfig) |
isExtensionProcessed | public boolean isExtensionProcessed()(Code) | | |
isRestricted | public boolean isRestricted()(Code) | | Indicates whether a MutableDynaClass is currently restricted.
If so, no changes to the existing registration of property names,
data types, readability, or writeability are allowed.
|
removeFormPropertyConfig | public void removeFormPropertyConfig(FormPropertyConfig config)(Code) | | Remove the specified form property configuration instance.
Parameters: config - FormPropertyConfig instance to be removed |
setRestricted | public void setRestricted(boolean restricted)(Code) | | Set whether a MutableDynaClass is currently restricted. If
so, no changes to the existing registration of property names, data
types, readability, or writeability are allowed.
|
toString | public String toString()(Code) | | Return a String representation of this object.
|
Fields inherited from org.apache.struts.config.BaseConfig | protected boolean configured(Code)(Java Doc)
|
|
|