Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Class BaseDataObject

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.BaseDataObject
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Serializable
Direct Known Subclasses:
JDBCDataObject

public abstract class BaseDataObject
extends Object
implements DataObject, Serializable

A base class that provides some functionality for all Data Objects

Author:
Michael Rimov
See Also:
Serialized Form

Field Summary
protected  String currentStatus
          Default constructed status
protected  org.apache.oro.text.regex.Pattern globalMask
           
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
BaseDataObject()
           
 
Method Summary
 org.apache.oro.text.regex.Pattern getGlobalMask()
          Get the compiled regular expression for this base data object.
 String getStatus()
          Get the status of this record.
 boolean isGlobalMasked()
          Return boolean if the data object has a mask set
 void setFieldsWithDefaults()
          Sets the fields of this object with the default values defined in the metadata. The behavior of this function is such that it only populates fields if there is no current value set. This is the same behavior that existed previously in DefaultAutoElement.
 void setGlobalMask(org.apache.oro.text.regex.Pattern newMask)
          Set a regular expression "mask" for this base data object that specifies it's valid values.
 void setStatus(String newStatus)
          Set the current status of a record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
add, checkField, clear, count, delete, equals, find, get, getAllAttributes, getAttribute, getDataField, getExecutor, getField, getFieldMetaData, getLocale, getMappedDataContext, getMaxRecords, getMetaData, getOffsetRecord, getQueryInterface, getValidValuesList, searchAndRetrieveList, searchAndRetrieveList, set, setAttribute, setLocale, setMaxRecords, setOffsetRecord, update
 
Methods inherited from interface com.jcorporate.expresso.core.cache.Cacheable
getKey
 
Methods inherited from interface com.jcorporate.expresso.core.dataobjects.ContextNested
getDataContext, setDataContext
 

Field Detail

currentStatus

protected String currentStatus
Default constructed status


globalMask

protected org.apache.oro.text.regex.Pattern globalMask
Constructor Detail

BaseDataObject

public BaseDataObject()
Method Detail

setStatus

public void setStatus(String newStatus)
Set the current status of a record

Specified by:
setStatus in interface DataObject
Parameters:
newStatus -

NEW: Record is new

CURRENT: Record is synchronized with the database

DELETED: Record has been deleted

UPDATED: Record has been updated since it was last written to the database


getStatus

public String getStatus()
Get the status of this record.

Specified by:
getStatus in interface DataObject
Returns:
String

setGlobalMask

public void setGlobalMask(org.apache.oro.text.regex.Pattern newMask)
Set a regular expression "mask" for this base data object that specifies it's valid values. The mask should already be compiled by the regular expression compiler

Specified by:
setGlobalMask in interface DataObject
Parameters:
newMask - The compiled regular expression mask

author Yves Henri AMAIZO


getGlobalMask

public org.apache.oro.text.regex.Pattern getGlobalMask()
Get the compiled regular expression for this base data object.

Specified by:
getGlobalMask in interface DataObject
Returns:
the precompiled regular expression mask

author Yves Henri AMAIZO


isGlobalMasked

public boolean isGlobalMasked()
Return boolean if the data object has a mask set

Specified by:
isGlobalMasked in interface DataObject
Returns:
True if the data object mask is set, else false if it is not

author Yves Henri AMAIZO


setFieldsWithDefaults

public void setFieldsWithDefaults()
                           throws DataException
Sets the fields of this object with the default values defined in the metadata. The behavior of this function is such that it only populates fields if there is no current value set. This is the same behavior that existed previously in DefaultAutoElement.

Specified by:
setFieldsWithDefaults in interface DataObject
Throws:
DataException - upon setField error.

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.