All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.featherfly.conversion.string.bp.BeanPropertyArrayFormatConvertor Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package cn.featherfly.conversion.string.bp;

import cn.featherfly.common.bean.BeanProperty;
import cn.featherfly.common.lang.ArrayUtils;
import cn.featherfly.conversion.annotation.Format;
import cn.featherfly.conversion.string.basic.ArrayConvertor;
import cn.featherfly.conversion.string.format.FormatConvertor;
import cn.featherfly.conversion.string.format.FormatType;

/**
 * 

* 数组转换器 *

* * @param * 数组自身类型 * @param * 数组项类型 * @author 钟冀 */ public abstract class BeanPropertyArrayFormatConvertor extends ArrayConvertor, E, FormatType> { /** * @param convertor * conversion */ public BeanPropertyArrayFormatConvertor(FormatConvertor convertor) { super(convertor); } /** * {@inheritDoc} */ @Override protected FormatType getArrayItemGenericType(BeanProperty beanProperty) { Format format = beanProperty.getAnnotation(Format.class); FormatType ft = new FormatType<>(getConvertor().getSourceType()); ft.setFormat(format.format()); ft.setFormats(ArrayUtils.toList(format.formats())); return ft; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy