planetj.database.field
Class FieldSet

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byplanetj.database.field.FieldSet
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class FieldSet
extends java.util.ArrayList

A FieldSet is a group of fields which have been grouped together for display purposes

See Also:
Serialized Form

Field Summary
static short FIELDS
          Indicates that the FieldSet objects should contain Fields objects
static short NAMES
          Indicates that the FieldSet objects should contain the names of fields
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
FieldSet()
          FieldSet constructor comment.
 
Method Summary
 void addAttributeAfterTitle(java.lang.String pAttribute)
          Sets the text, HTML, XML, etc...
 boolean containsOneOf(java.util.List fieldNames)
          Checks to see if this FieldSet contains one Field in the given List of Field names.
 boolean displayHeaderRow()
          True if header should be displayed.
 boolean displayHeaderRowAsLegend()
          True if header should be displayed as legend for html fieldset.
 boolean equals(java.lang.Object pObj)
           
 java.lang.String getAttributeAfterTitle()
          Returns the text, HTML, XML, etc...
static java.util.List getFieldNameSets(RowCollection pRc)
          Returns a List containing FieldSet objects.
 FieldSet getFieldSetForGivenFields(java.util.List pFieldNames)
          Get a FieldSet that contains only the given fields.
static java.util.List getFieldSets(java.util.List pFieldNameSets, Row pRow)
          Gets a List containing FieldSet objects.
static java.util.List getFieldSets(Row pRow)
          Gets a List containing FieldSet objects.
static java.util.List getFieldSetsFromRow(Row row)
          Returns a List containing FieldSet objects.
 java.lang.String getName()
          Gets the name of this FieldSet
 java.lang.String getSafeName()
          Gets the name of this FieldSet, without any characters that are likely to cause issues
 boolean hasDisplayableFields(ExecutingContext ec)
          Tests if there are one or more fields in this field set which should be displayed
 int hashCode()
           
 boolean remove(java.lang.Object pObj)
           
 void setDisplayHeaderRow(boolean display)
          Set header to display.
 void setDisplayHeaderRowAsLegend(boolean isLegend)
          Set header to display.
 void setName(java.lang.String newName)
          Sets the name of this FieldSet
 java.lang.String toString()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

NAMES

public static final short NAMES
Indicates that the FieldSet objects should contain the names of fields

See Also:
Constant Field Values

FIELDS

public static final short FIELDS
Indicates that the FieldSet objects should contain Fields objects

See Also:
Constant Field Values
Constructor Detail

FieldSet

public FieldSet()
FieldSet constructor comment.

Method Detail

addAttributeAfterTitle

public void addAttributeAfterTitle(java.lang.String pAttribute)
Sets the text, HTML, XML, etc... that will appear after the FieldSet's title.


containsOneOf

public boolean containsOneOf(java.util.List fieldNames)
Checks to see if this FieldSet contains one Field in the given List of Field names.


displayHeaderRow

public boolean displayHeaderRow()
True if header should be displayed.


displayHeaderRowAsLegend

public boolean displayHeaderRowAsLegend()
True if header should be displayed as legend for html fieldset.


equals

public boolean equals(java.lang.Object pObj)

getAttributeAfterTitle

public java.lang.String getAttributeAfterTitle()
Returns the text, HTML, XML, etc... that will appear after the FieldSet's title.


getFieldNameSets

public static java.util.List getFieldNameSets(RowCollection pRc)
                                       throws CMException
Returns a List containing FieldSet objects. Each FieldSet object contains *NAMES* of fields that belong in that field set. This List represents a halfway point in the procedure required to get the fields in a field set - the rest of the procedure can only be done once we have a specific Row. The names may include the names of fields which aren't in the RowCollection, but exist in tables referenced by the RowCollection. At some point, Rows in the RowCollection may have those fields added. There will always be at least one FieldSet returned in the List (assuming any fields exist in the RowCollection), even if no field sets were specified in the field descriptors (in this case, the field set will not have a name).

Throws:
CMException

getFieldSetForGivenFields

public FieldSet getFieldSetForGivenFields(java.util.List pFieldNames)
                                   throws CMException
Get a FieldSet that contains only the given fields.

Throws:
CMException

getFieldSets

public static java.util.List getFieldSets(java.util.List pFieldNameSets,
                                          Row pRow)
Gets a List containing FieldSet objects. Each FieldSet object contains the Field objects corresponding to the fields which are in the Row, and whose names are in the FieldSet passed in to this method.


getFieldSets

public static java.util.List getFieldSets(Row pRow)
                                   throws CMException
Gets a List containing FieldSet objects. Each FieldSet object contains the Field objects corresponding to the fields which are in the Row, and whose names are in the FieldSet passed in to this method. This method is more expensive than the two argument version, but can be invoked for Rows which are not in a RowCollection.

Throws:
CMException

getFieldSetsFromRow

public static java.util.List getFieldSetsFromRow(Row row)
                                          throws CMException
Returns a List containing FieldSet objects. Each FieldSet object will contain either the fields that belong in that field set.

Parameters:
row - Row containing Fields to get FieldSets for
Throws:
CMException

getName

public java.lang.String getName()
Gets the name of this FieldSet


getSafeName

public java.lang.String getSafeName()
Gets the name of this FieldSet, without any characters that are likely to cause issues


hasDisplayableFields

public boolean hasDisplayableFields(ExecutingContext ec)
                             throws CMException
Tests if there are one or more fields in this field set which should be displayed

Throws:
CMException

hashCode

public int hashCode()

remove

public boolean remove(java.lang.Object pObj)

setDisplayHeaderRow

public void setDisplayHeaderRow(boolean display)
Set header to display.


setDisplayHeaderRowAsLegend

public void setDisplayHeaderRowAsLegend(boolean isLegend)
Set header to display.


setName

public void setName(java.lang.String newName)
Sets the name of this FieldSet


toString

public java.lang.String toString()