if (element != null) {
switch (element.type()) {
case DATE:
if (element.format().type() != FormatType.DATE) {
throw new AppException("E00001");
}
break;
case DATE_TIME:
if (element.format().type() != FormatType.TIME) {
throw new AppException("E00001");
}
break;
case LINK:
if (element.link().url() == null) {
throw new AppException("E00004");
}
break;
case SELECT:
if (element.source() == null) {
throw new AppException("E00003");
}
break;
default:
break;