fc.web.forms
Class FieldRef

java.lang.Object
  extended by fc.web.forms.FieldRef

public final class FieldRef
extends Object

Keeps track of a set of related/grouped fields in a form.

A fieldref is is useful when a set of fields are created programmatically from a database table and need to be retrieved from the form (but we don't know the names of those fields since they were created dynamically -- however, those fields can be added both to the form and to a fieldref and obtained via then the name of the fieldref (whose name we do know.)

Note: Any fields contained in this object must also be added directly to the form.


Constructor Summary
FieldRef(String name)
          Creates a new field with the specified name.
FieldRef(String name, Object obj)
          Creates a new field with the specified name and the specified object (which may be any data structure like a list, map or whatever containing references to fields in the form).
 
Method Summary
 void add(Object obj)
          Adds an object to this fieldref.
 List getList()
          Returns the data object contained in this fieldref as a List.
 Map getMap()
          Returns the data object contained in this fieldref as a Map.
 Object getObject()
          Returns the data object contained in this fieldref.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldRef

public FieldRef(String name)
Creates a new field with the specified name. All fieldref's in a particular form must have a unique name.


FieldRef

public FieldRef(String name,
                Object obj)
Creates a new field with the specified name and the specified object (which may be any data structure like a list, map or whatever containing references to fields in the form).

Method Detail

add

public void add(Object obj)
Adds an object to this fieldref. The object will typically be some datastructure that contains references to fields in the form.


getList

public List getList()
Returns the data object contained in this fieldref as a List.


getMap

public Map getMap()
Returns the data object contained in this fieldref as a Map.


getObject

public Object getObject()
Returns the data object contained in this fieldref.


toString

public String toString()
Overrides:
toString in class Object