use of org.jaffa.metadata.DateOnlyFieldMetaData in project jaffa-framework by jaffa-projects.
the class DateOnlyFieldValidator 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) {
DateOnlyFieldMetaData meta = new DateOnlyFieldMetaData(null, getLabelToken(), null, getLayout(), getMinValue(), getMaxValue());
if (value instanceof DateOnly)
FieldValidator.validate((DateOnly) value, meta, false);
else if (value instanceof Date)
FieldValidator.validate(new DateOnly((Date) value), meta, false);
else
FieldValidator.validateData(value.toString(), meta);
}
}
use of org.jaffa.metadata.DateOnlyFieldMetaData in project jaffa-framework by jaffa-projects.
the class EditBoxForm method getDataTypeDateOnlyWM.
public WidgetModel getDataTypeDateOnlyWM() {
if (w_dataTypeDateOnly == null) {
w_dataTypeDateOnly = new EditBoxModel(new DateOnlyFieldMetaData());
w_dataTypeDateOnly.setValue(getDataTypeDateOnly());
}
return w_dataTypeDateOnly;
}
Aggregations