Class FieldRef

java.lang.Object
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

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    void
    add(Object obj)
    Adds an object to this fieldref.
    Returns the data object contained in this fieldref as a List.
    Returns the data object contained in this fieldref as a Map.
    Returns the data object contained in this fieldref.
     

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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