com.ibm.commerce.pa.datatype
Class DsData

java.lang.Object
  |
  +--com.ibm.commerce.pa.datatype.DsData
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public abstract class DsData
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The DsData class is the abstract base class for all datatypes in this package. It defines the default behavior for all datatypes thus making the setting of the data polymorphic so that clients can dynamically create a datatype from the registry and set its data.

See Also:
Serialized Form

Field Summary
protected  java.util.Locale locale
          This is the locale that is associated with the data in this object.
 
Constructor Summary
DsData()
          DsData constructor.
 
Method Summary
 java.lang.Object clone()
          This method will make a clone of this object.
abstract  void fetchResults(java.sql.ResultSet rs, int col)
          This method fetches the data for this object from an SQL result set.
abstract  java.lang.Object getData()
          This method allows access to the raw data inside the object.
 java.util.Locale getLocale()
          Get the locale associated with the data in this object.
abstract  java.lang.String getPresentationString()
          This method returns the value of this Data object formatted for presentation.
abstract  java.lang.String getUnformattedData()
          Get the string representation of the data before any formatting is applied.
static DsData instantiate(java.lang.String className)
          This method will instantiate a DsData object from it's class name.
abstract  void setData(java.lang.Object obj)
          This method provides a polymorphic way to set the data in a DsData object.
 void setLocale(java.util.Locale newValue)
          Set the locale to be associated with the data in this object.
 java.lang.String toString()
          Return the presentation string for this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

locale

protected java.util.Locale locale
This is the locale that is associated with the data in this object.
Constructor Detail

DsData

public DsData()
DsData constructor.
Method Detail

clone

public java.lang.Object clone()
This method will make a clone of this object.
Overrides:
clone in class java.lang.Object
Returns:
The cloned object.

fetchResults

public abstract void fetchResults(java.sql.ResultSet rs,
                                  int col)
                           throws java.sql.SQLException
This method fetches the data for this object from an SQL result set.
Parameters:
rs - The SQL result set.
col - The column index.

getData

public abstract java.lang.Object getData()
This method allows access to the raw data inside the object. It must be implemented by all subclasses and is needed so that data can be copied in a generic way.
Returns:
The raw internal data.

getLocale

public java.util.Locale getLocale()
Get the locale associated with the data in this object.
Returns:
The locale.

getPresentationString

public abstract java.lang.String getPresentationString()
This method returns the value of this Data object formatted for presentation.
Returns:
The formatted value.

getUnformattedData

public abstract java.lang.String getUnformattedData()
Get the string representation of the data before any formatting is applied.
Returns:
The data value.

instantiate

public static DsData instantiate(java.lang.String className)
This method will instantiate a DsData object from it's class name. If the class cannot be instantiated, a null will be returned.
Parameters:
className - The name of the derived DsData class you want to instantiate.
Returns:
An object in the DsData class hierarchy.

setData

public abstract void setData(java.lang.Object obj)
This method provides a polymorphic way to set the data in a DsData object. The actual data type that's contained in the derived classes will almost certainly be a specific type. It is expected that subclasses will have to throw an IllegalArgumentException if the wrong data type is passed in.
Parameters:
newValue - The data to be set in the object.

setLocale

public void setLocale(java.util.Locale newValue)
Set the locale to be associated with the data in this object.
Parameters:
newValue - The locale.

toString

public java.lang.String toString()
Return the presentation string for this object.
Overrides:
toString in class java.lang.Object
Returns:
The presentation string.