/** * Get a suitable {@link BeanProperty} builder according to property type. * @param propertyDescriptor Property descriptor * @param annotations The annotations bound to the bean property * @return {@link BeanProperty} builder */ @SuppressWarnings("unchecked") private static BeanProperty.Builder<?> getPropertyBuilder(PropertyDescriptor propertyDescriptor, Annotation[] annotations) { // check type if (TypeUtils.isString(propertyDescriptor.getPropertyType())) { return StringBeanProperty.builder(propertyDescriptor.getName()); } if (TypeUtils.isBoolean(propertyDescriptor.getPropertyType())) { return BooleanBeanProperty.builder(propertyDescriptor.getName(), propertyDescriptor.getPropertyType().isPrimitive()); } if (TypeUtils.isNumber(propertyDescriptor.getPropertyType())) { return NumericBeanProperty.builder(propertyDescriptor.getName(), (Class<? extends Number>) propertyDescriptor.getPropertyType()); } if (TypeUtils.isDate(propertyDescriptor.getPropertyType()) || TypeUtils.isTemporal(propertyDescriptor.getPropertyType())) { return TemporalBeanProperty.builder(propertyDescriptor.getName(), propertyDescriptor.getPropertyType()); } // default return BeanProperty.builder(propertyDescriptor.getName(), propertyDescriptor.getPropertyType()); }
return dateFormat.format((Date) value); if (TypeUtils.isTemporal(value.getClass())) { TemporalType type = TemporalType.getTemporalType((Temporal) value).orElse(TemporalType.DATE); switch (type) {
if (TypeUtils.isTemporal(valueType)) {
if (TypeUtils.isTemporal(propertyType)) {
if (TypeUtils.isTemporal(propertyType)) {