public class DateModel extends BeanModel implements TemplateDateModel
Date
into a reflective model.
Beside acting as a TemplateDateModel
, you can call all Java methods
on these objects as well.DATE, DATETIME, TIME, TYPE_NAMES, UNKNOWN
NOTHING
Constructor and Description |
---|
DateModel(java.util.Date date,
BeansWrapper wrapper)
Creates a new model that wraps the specified date object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getAsDate()
Returns the date value.
|
int |
getDateType()
Returns the type of the date.
|
get, getAdaptedObject, getWrappedObject, hasPlainGetMethod, invokeGenericGet, isEmpty, keys, keySet, size, toString, unwrap, values, wrap
public DateModel(java.util.Date date, BeansWrapper wrapper)
date
- the date object to wrap into a model.wrapper
- the BeansWrapper
associated with this model.
Every model has to have an associated BeansWrapper
instance. The
model gains many attributes from its wrapper, including the caching
behavior, method exposure level, method-over-item shadowing policy etc.public java.util.Date getAsDate()
TemplateDateModel
null
.getAsDate
in interface TemplateDateModel
public int getDateType()
TemplateDateModel
getDateType
in interface TemplateDateModel