com.jtri.base
Class BaseDTO

java.lang.Object
  extended bycom.jtri.base.BaseDTO
All Implemented Interfaces:
IMapped, IPagedInfoForm, java.io.Serializable
Direct Known Subclasses:
LoveRow

public abstract class BaseDTO
extends java.lang.Object
implements java.io.Serializable, IPagedInfoForm, IMapped

The Data Transfer Object is the base class for each row of information in a form. This class holds paging information reference, holds reference to paged subset of data, and implements default conversion from string to java datatypes based on the converter data. This also has state information for inclusion,changed state.

Author:
atorres
See Also:
Serialized Form

Constructor Summary
BaseDTO()
           
 
Method Summary
static void buildPageInfos(PageStructure psf, IPagedInfoForm form, Row parent)
           
 java.lang.Object convertProperty(java.lang.String prop)
          convert a property to the the business object object
 void fromValueObject(java.lang.Object vo)
           
static void fromValueObjects(PageStructure ps, java.util.List forms, java.util.Collection vos)
           
 java.lang.String get_status()
           
abstract  java.util.Map getConverter()
          Return a map of property->FieldMapping.
 PageInfo getPageInfo(java.lang.String colName)
           
 java.util.Map getPageInfos()
           
 boolean hasChanged()
           
 boolean is_removed()
           
static boolean isReadable(java.lang.Object vo, java.lang.String prop)
           
static void processPageInfo(PageStructure psf, java.lang.Object form)
           
 PageStructure readPageStructure()
           
static boolean removeNew(java.util.List infos, IPagedInfoForm iform)
           
 void set_removed(boolean stat)
           
 void set_status(java.lang.String stat)
           
 void setPageInfo(java.lang.String colName, PageInfo info)
           
 void setPageInfos(java.util.HashMap map)
           
 java.util.Map toMap()
           
 java.lang.String toString()
           
static java.util.List toValueObjects(PageStructure ps, java.lang.Class pclass, java.util.List forms)
           
 void unconvertProperty(java.lang.String prop, java.lang.Object value)
           
 void writePageStructure(PageStructure structure)
          secure this method against instrospection attack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseDTO

public BaseDTO()
Method Detail

set_status

public void set_status(java.lang.String stat)

get_status

public java.lang.String get_status()

set_removed

public void set_removed(boolean stat)

is_removed

public boolean is_removed()

convertProperty

public java.lang.Object convertProperty(java.lang.String prop)
                                 throws java.lang.Exception
Description copied from interface: IMapped
convert a property to the the business object object

Specified by:
convertProperty in interface IMapped
Parameters:
prop -
Returns:
Throws:
java.lang.Exception

unconvertProperty

public void unconvertProperty(java.lang.String prop,
                              java.lang.Object value)
                       throws java.lang.Exception
Throws:
java.lang.Exception

toMap

public java.util.Map toMap()

fromValueObject

public void fromValueObject(java.lang.Object vo)

getConverter

public abstract java.util.Map getConverter()
Description copied from interface: IMapped
Return a map of property->FieldMapping. Each fieldMapping will explain how to load and (if it's the case) how to save back de object

Specified by:
getConverter in interface IMapped
Returns:

processPageInfo

public static void processPageInfo(PageStructure psf,
                                   java.lang.Object form)
                            throws java.lang.Exception
Throws:
java.lang.Exception

removeNew

public static boolean removeNew(java.util.List infos,
                                IPagedInfoForm iform)
                         throws java.lang.Exception
Throws:
java.lang.Exception

buildPageInfos

public static void buildPageInfos(PageStructure psf,
                                  IPagedInfoForm form,
                                  Row parent)
                           throws java.lang.Exception
Throws:
java.lang.Exception

toValueObjects

public static java.util.List toValueObjects(PageStructure ps,
                                            java.lang.Class pclass,
                                            java.util.List forms)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

hasChanged

public boolean hasChanged()
                   throws java.lang.Exception
Throws:
java.lang.Exception

fromValueObjects

public static void fromValueObjects(PageStructure ps,
                                    java.util.List forms,
                                    java.util.Collection vos)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getPageInfos

public java.util.Map getPageInfos()
Returns:

setPageInfos

public void setPageInfos(java.util.HashMap map)
Parameters:
map -

setPageInfo

public void setPageInfo(java.lang.String colName,
                        PageInfo info)
Specified by:
setPageInfo in interface IPagedInfoForm

getPageInfo

public PageInfo getPageInfo(java.lang.String colName)
Specified by:
getPageInfo in interface IPagedInfoForm

readPageStructure

public PageStructure readPageStructure()
Returns:

writePageStructure

public void writePageStructure(PageStructure structure)
secure this method against instrospection attack

Parameters:
structure -

toString

public java.lang.String toString()

isReadable

public static boolean isReadable(java.lang.Object vo,
                                 java.lang.String prop)
                          throws java.lang.Exception
Throws:
java.lang.Exception