use of org.jaffa.metadata.DateTimeFieldMetaData in project jaffa-framework by jaffa-projects.
the class EditBoxForm method getDataTypeDateTimeWM.
public WidgetModel getDataTypeDateTimeWM() {
if (w_dataTypeDateTime == null) {
w_dataTypeDateTime = new EditBoxModel(new DateTimeFieldMetaData());
w_dataTypeDateTime.setValue(getDataTypeDateTime());
}
return w_dataTypeDateTime;
}
use of org.jaffa.metadata.DateTimeFieldMetaData in project jaffa-framework by jaffa-projects.
the class DateTimeFieldValidator method validate.
/**
* The RulesEngine will invoke this method to perform the field validation.
* @throws ValidationException if any validation rule fails.
* @throws FrameworkException if any framework error occurs.
*/
public void validate() throws ValidationException, FrameworkException {
Object value = getValue();
if (value != null) {
DateTimeFieldMetaData meta = new DateTimeFieldMetaData(null, getLabelToken(), null, getLayout(), getMinValue(), getMaxValue());
if (value instanceof DateTime)
FieldValidator.validate((DateTime) value, meta, false);
else if (value instanceof Date)
FieldValidator.validate(new DateTime((Date) value), meta, false);
else
FieldValidator.validateData(value.toString(), meta);
}
}
Aggregations