org.dbforms.config
Class FieldValue

java.lang.Object
  extended by org.dbforms.config.FieldValue
All Implemented Interfaces:
Serializable, Cloneable

public class FieldValue
extends Object
implements Cloneable, Serializable

This helper-class was originally used to maintain the mapped values between Main-Form and Sub-Form in the taglib package. in meantime it is used as holder of data in many places.
It also performs operations that involve "fields" and associated "values" (i.e. building blocks of SQL SELECT statements, etc) Now it's handles all the stuf of parsing the resended strings back into java objects.

Author:
Joe Peer, Philip Grunikiewicz, Henner Kollmann
See Also:
Serialized Form

Constructor Summary
FieldValue(Field field, String fieldValue)
          Creates a new FieldValue object.
 
Method Summary
 Object clone()
          Clone this object.
static FieldValue createFieldValueForSearching(Field field, String fieldValue, Locale locale, int operator, int searchMode, int searchAlgorithm, boolean logicalOR)
          DOCUMENT ME!
static FieldValue createFieldValueForSorting(Field field, int sortDirection)
          DOCUMENT ME!
 Field getField()
          Gets the field attribute of the FieldValue object
 String getFieldValue()
          Gets the fieldValue attribute of the FieldValue object
 Object getFieldValueAsObject()
          parses the given fieldValue according to the given type and creates an java object of the needed type. during the parsing the given locale/format settings will be used.
 FileHolder getFileHolder()
          Return the fileHolder object for this field.
 Locale getLocale()
          DOCUMENT ME!
 boolean getLogicalOR()
          Get the logicalOR attribute of this FieldValue object.
 String getOldValue()
          Get the oldValue of this Field object.
 Object getOldValueAsObject()
          DOCUMENT ME!
 int getOperator()
          Gets the operator attribute of the FieldValue object
 String getPattern()
          DOCUMENT ME!
 boolean getRenderHiddenHtmlTag()
          Gets the renderHiddenHtmlTag attribute of the FieldValue object
 int getSearchAlgorithm()
          Gets the searchAlgorithm attribute of the FieldValue object
 int getSearchMode()
          Gets the searchMode attribute of the FieldValue object
 int getSortDirection()
          Gets the sortDirection attribute of the FieldValue object
static void invert(FieldValue[] fv)
          Inverts the sorting direction of all FieldValue objects in the given array [ASC-->DESC et vice versa]
static boolean isNull(FieldValue[] arr)
          test if given FieldValue[] is empty
 void setField(Field field)
          Sets the field attribute of the FieldValue object
 void setFieldValue(String fieldValue)
          Sets the fieldValue attribute of the FieldValue object
 void setFileHolder(FileHolder fileHolder)
          Sets the fileHolder.
 void setLocale(Locale locale)
          DOCUMENT ME!
 void setLogicalOR(boolean newLogicalOR)
          Set the logicalOR attribute of this FieldValue object.
 void setOldValue(String string)
          Set the oldValue for this Field object.
 void setOperator(int i)
          sets the operator
 void setPattern(String pattern)
          DOCUMENT ME!
 void setRenderHiddenHtmlTag(boolean renderHiddenHtmlTag)
          Sets the renderHiddenHtmlTag attribute of the FieldValue object
 void setSearchAlgorithm(int searchAlgorithm)
          Sets the searchAlgorithm attribute of the FieldValue object
 void setSearchMode(int searchMode)
          Sets the searchMode attribute of the FieldValue object
 void setSortDirection(int sortDirection)
          Sets the sortDirection attribute of the FieldValue object
 String toString()
          Get the String representation of this object.
static String toString(FieldValue[] fieldValues)
          Dump the input FieldValue array
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldValue

public FieldValue(Field field,
                  String fieldValue)
Creates a new FieldValue object.

Parameters:
field - the name of the field
fieldValue - the string representation of the value of the field
Method Detail

createFieldValueForSearching

public static FieldValue createFieldValueForSearching(Field field,
                                                      String fieldValue,
                                                      Locale locale,
                                                      int operator,
                                                      int searchMode,
                                                      int searchAlgorithm,
                                                      boolean logicalOR)
DOCUMENT ME!

Parameters:
field - DOCUMENT ME!
fieldValue - DOCUMENT ME!
locale - DOCUMENT ME!
operator - DOCUMENT ME!
searchMode - DOCUMENT ME!
searchAlgorithm - DOCUMENT ME!
logicalOR - DOCUMENT ME!
Returns:
DOCUMENT ME!

createFieldValueForSorting

public static FieldValue createFieldValueForSorting(Field field,
                                                    int sortDirection)
DOCUMENT ME!

Parameters:
field - DOCUMENT ME!
sortDirection - DOCUMENT ME!
Returns:
DOCUMENT ME!

setField

public void setField(Field field)
Sets the field attribute of the FieldValue object

Parameters:
field - The new field value

getField

public Field getField()
Gets the field attribute of the FieldValue object

Returns:
The field value

setFieldValue

public void setFieldValue(String fieldValue)
Sets the fieldValue attribute of the FieldValue object

Parameters:
fieldValue - The new fieldValue value

getFieldValue

public String getFieldValue()
Gets the fieldValue attribute of the FieldValue object

Returns:
The fieldValue value

getFieldValueAsObject

public Object getFieldValueAsObject()
parses the given fieldValue according to the given type and creates an java object of the needed type. during the parsing the given locale/format settings will be used.

Returns:
Object of given type;

setFileHolder

public void setFileHolder(FileHolder fileHolder)
Sets the fileHolder.

Parameters:
fileHolder - The fileHolder to set

getFileHolder

public FileHolder getFileHolder()
Return the fileHolder object for this field.

Returns:
the fileHolder object of this field

setLocale

public void setLocale(Locale locale)
DOCUMENT ME!

Parameters:
locale -

getLocale

public Locale getLocale()
DOCUMENT ME!

Returns:

setLogicalOR

public void setLogicalOR(boolean newLogicalOR)
Set the logicalOR attribute of this FieldValue object.

Parameters:
newLogicalOR - the logicalOR attribute value to set

getLogicalOR

public boolean getLogicalOR()
Get the logicalOR attribute of this FieldValue object.

Returns:
the logicalOR attribute of this FieldValue object

isNull

public static final boolean isNull(FieldValue[] arr)
test if given FieldValue[] is empty

Parameters:
arr - FieldValue[] to test
Returns:
true if array is null or empty

setOldValue

public void setOldValue(String string)
Set the oldValue for this Field object.

Parameters:
string - the oldValue for this Field object

getOldValue

public String getOldValue()
Get the oldValue of this Field object.

Returns:
the oldValue of this Field object

getOldValueAsObject

public Object getOldValueAsObject()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setOperator

public void setOperator(int i)
sets the operator

Parameters:
i -

getOperator

public int getOperator()
Gets the operator attribute of the FieldValue object

Returns:
The operator value

setPattern

public void setPattern(String pattern)
DOCUMENT ME!

Parameters:
pattern -

getPattern

public String getPattern()
DOCUMENT ME!

Returns:

setRenderHiddenHtmlTag

public void setRenderHiddenHtmlTag(boolean renderHiddenHtmlTag)
Sets the renderHiddenHtmlTag attribute of the FieldValue object

Parameters:
renderHiddenHtmlTag - The new renderHiddenHtmlTag value

getRenderHiddenHtmlTag

public boolean getRenderHiddenHtmlTag()
Gets the renderHiddenHtmlTag attribute of the FieldValue object

Returns:
The renderHiddenHtmlTag value

setSearchAlgorithm

public void setSearchAlgorithm(int searchAlgorithm)
Sets the searchAlgorithm attribute of the FieldValue object

Parameters:
searchAlgorithm - The new searchAlgorithm value

getSearchAlgorithm

public int getSearchAlgorithm()
Gets the searchAlgorithm attribute of the FieldValue object

Returns:
The searchAlgorithm value

setSearchMode

public void setSearchMode(int searchMode)
Sets the searchMode attribute of the FieldValue object

Parameters:
searchMode - The new searchMode value

getSearchMode

public int getSearchMode()
Gets the searchMode attribute of the FieldValue object

Returns:
The searchMode value

setSortDirection

public void setSortDirection(int sortDirection)
Sets the sortDirection attribute of the FieldValue object

Parameters:
sortDirection - The new sortDirection value

getSortDirection

public int getSortDirection()
Gets the sortDirection attribute of the FieldValue object

Returns:
The sortDirection value

clone

public Object clone()
Clone this object.

Overrides:
clone in class Object
Returns:
a cloned FieldValue object

invert

public static void invert(FieldValue[] fv)
Inverts the sorting direction of all FieldValue objects in the given array [ASC-->DESC et vice versa]

Parameters:
fv - the array of FieldValue objects

toString

public String toString()
Get the String representation of this object.

Overrides:
toString in class Object
Returns:
the String representation of this object

toString

public static String toString(FieldValue[] fieldValues)
Dump the input FieldValue array

Parameters:
fieldValues - the fieldValues array
Returns:
the string representation of the FieldValues object


Copyright © 2002-2006 DbForms. All Rights Reserved.