org.apache.struts.config
Class FormPropertyConfig

java.lang.Object
  extended by org.apache.struts.config.BaseConfig
      extended by org.apache.struts.config.FormPropertyConfig
All Implemented Interfaces:
java.io.Serializable

public class FormPropertyConfig
extends BaseConfig

A JavaBean representing the configuration information of a <form-property> element in a Struts configuration file.

Since:
Struts 1.1
Version:
$Rev: 471754 $ $Date: 2005-11-12 11:52:08 -0500 (Sat, 12 Nov 2005)$
See Also:
Serialized Form

Field Summary
protected  java.lang.String initial
          String representation of the initial value for this property.
protected  java.lang.String name
          The JavaBean property name of the property described by this element.
protected  java.lang.String reset
          The conditions under which the property described by this element should be reset to its initial value when the form's reset method is called.
protected  int size
          The size of the array to be created if this property is an array type and there is no specified initial value.
protected  java.lang.String type
          The fully qualified Java class name of the implementation class of this bean property, optionally followed by [] to indicate that the property is indexed.
 
Fields inherited from class org.apache.struts.config.BaseConfig
configured
 
Constructor Summary
FormPropertyConfig()
          Standard no-arguments constructor for dynamic instantiation.
FormPropertyConfig(java.lang.String name, java.lang.String type, java.lang.String initial)
          Constructor that preconfigures the relevant properties.
FormPropertyConfig(java.lang.String name, java.lang.String type, java.lang.String initial, int size)
          Constructor that preconfigures the relevant properties.
FormPropertyConfig(java.lang.String name, java.lang.String type, java.lang.String initial, java.lang.String reset)
          Constructor that preconfigures the relevant properties.
FormPropertyConfig(java.lang.String name, java.lang.String type, java.lang.String initial, java.lang.String reset, int size)
          Constructor that preconfigures the relevant properties.
 
Method Summary
 java.lang.String getInitial()
           
 java.lang.String getName()
           
 java.lang.String getReset()
           
 int getSize()
           
 java.lang.String getType()
           
 java.lang.Class getTypeClass()
          Return a Class corresponds to the value specified for the type property, taking into account the trailing "[]" for arrays (as well as the ability to specify primitive Java types).
 void inheritFrom(FormPropertyConfig config)
          Inherit values that have not been overridden from the provided config object.
 java.lang.Object initial()
          Return an object representing the initial value of this property.
 void setInitial(java.lang.String initial)
           
 void setName(java.lang.String name)
           
 void setReset(java.lang.String reset)
           
 void setSize(int size)
           
 void setType(java.lang.String type)
           
 java.lang.String toString()
          Return a String representation of this object.
 
Methods inherited from class org.apache.struts.config.BaseConfig
copyProperties, freeze, getProperties, getProperty, inheritProperties, setProperties, setProperty, throwIfConfigured
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initial

protected java.lang.String initial
String representation of the initial value for this property.


name

protected java.lang.String name
The JavaBean property name of the property described by this element.


reset

protected java.lang.String reset

The conditions under which the property described by this element should be reset to its initial value when the form's reset method is called.

This may be set to true (to always reset the property) or a comma-separated list of HTTP request methods.

Since:
Struts 1.3

size

protected int size

The size of the array to be created if this property is an array type and there is no specified initial value. This value must be non-negative.

Since:
Struts 1.1

type

protected java.lang.String type
The fully qualified Java class name of the implementation class of this bean property, optionally followed by [] to indicate that the property is indexed.

Constructor Detail

FormPropertyConfig

public FormPropertyConfig()
Standard no-arguments constructor for dynamic instantiation.


FormPropertyConfig

public FormPropertyConfig(java.lang.String name,
                          java.lang.String type,
                          java.lang.String initial)
Constructor that preconfigures the relevant properties.

Parameters:
name - Name of this property
type - Fully qualified class name of this property
initial - Initial value of this property (if any)

FormPropertyConfig

public FormPropertyConfig(java.lang.String name,
                          java.lang.String type,
                          java.lang.String initial,
                          java.lang.String reset)
Constructor that preconfigures the relevant properties.

Parameters:
name - Name of this property
type - Fully qualified class name of this property
initial - Initial value of this property (if any)
reset - The conditions under which this property will be reset to its initial value.

FormPropertyConfig

public FormPropertyConfig(java.lang.String name,
                          java.lang.String type,
                          java.lang.String initial,
                          int size)
Constructor that preconfigures the relevant properties.

Parameters:
name - Name of this property
type - Fully qualified class name of this property
initial - Initial value of this property (if any)
size - Size of the array to be created if this property is an array with no defined initial value

FormPropertyConfig

public FormPropertyConfig(java.lang.String name,
                          java.lang.String type,
                          java.lang.String initial,
                          java.lang.String reset,
                          int size)
Constructor that preconfigures the relevant properties.

Parameters:
name - Name of this property
type - Fully qualified class name of this property
initial - Initial value of this property (if any)
size - Size of the array to be created if this property is an array with no defined initial value
reset - The conditions under which this property will be reset to its initial value.
Method Detail

getInitial

public java.lang.String getInitial()

setInitial

public void setInitial(java.lang.String initial)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getReset

public java.lang.String getReset()

setReset

public void setReset(java.lang.String reset)

getSize

public int getSize()

setSize

public void setSize(int size)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

getTypeClass

public java.lang.Class getTypeClass()
Return a Class corresponds to the value specified for the type property, taking into account the trailing "[]" for arrays (as well as the ability to specify primitive Java types).


initial

public java.lang.Object initial()

Return an object representing the initial value of this property. This is calculated according to the following algorithm:


inheritFrom

public void inheritFrom(FormPropertyConfig config)
                 throws java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        java.lang.InstantiationException,
                        java.lang.ClassNotFoundException

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 MyCustomFormPropertyConfig) {
     MyCustomFormPropertyConfig myConfig =
         (MyCustomFormPropertyConfig) config;

     if (getMyCustomProp() == null) {
         setMyCustomProp(myConfig.getMyCustomProp());
     }
 }
 

Parameters:
config - The object that this instance will be inheriting its values from.
Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.ClassNotFoundException

toString

public java.lang.String toString()
Return a String representation of this object.

Overrides:
toString in class java.lang.Object


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.