org.beanfabrics.model
Interface IDatePM

All Superinterfaces:
Bean, ContextOwner, ITextPM, IValuePM, PresentationModel, Supportable, Validatable
All Known Implementing Classes:
DatePM

public interface IDatePM
extends ITextPM

Author:
Michael Karneim, Max Gensthaler

Method Summary
 java.util.Date getDate()
          Return the date represented by this object.
 java.text.DateFormat getFormat()
          Return the format to be used by this object to check the input and convert the input to a Date and vice versa.
 void setDate(java.util.Date date)
          Set the Date to be represented by this object.
 void setFormat(java.text.DateFormat newFormat)
          Set the format to be used by this object to check the input and convert the input to a Date and vice versa.
 
Methods inherited from interface org.beanfabrics.model.ITextPM
getOptions, getText, isModified, preset, reformat, reset, setOptions, setText
 
Methods inherited from interface org.beanfabrics.model.IValuePM
getComparable, getDescription, getTitle, isEditable, isEmpty, isMandatory, setDescription, setEditable, setMandatory, setTitle
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, getValidator, isValid, revalidate
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 

Method Detail

getFormat

java.text.DateFormat getFormat()
Return the format to be used by this object to check the input and convert the input to a Date and vice versa.


setFormat

void setFormat(java.text.DateFormat newFormat)
Set the format to be used by this object to check the input and convert the input to a Date and vice versa.

I.e. to set a format showing date and time do:

 DateFormat format = DateFormat.getDateTimeInstance();
 format.setLenient(false);
 setFormat(format);
 

Parameters:
newFormat - format to use for Date-String conversion

getDate

java.util.Date getDate()
                       throws ConversionException
Return the date represented by this object.

Throws:
ConversionException - thrown if the text of this object cannot be parsed as date by the given format

setDate

void setDate(java.util.Date date)
Set the Date to be represented by this object.

Parameters:
date - Date to set


© 2010 by Michael Karneim, http://www.beanfabrics.org