class CsvProcessor implements FileProcessor {

    @Override
    public void importBean(Object bean, String filePath) throws IOException {
        Class<?> clazz = bean.getClass();

        List<FieldDesc> list = processeCache.getFieldDescs(clazz);
        Assert.assertTrue(CollectionUtil.isNotEmpty(list), "FieldDesc is not empty");

        String data = toCsvLine(list, bean);
        List<String> titles = processeCache.getTitles(clazz);

        if (CollectionUtil.isEmpty(titles)) {
            WriterUtil.writeLinesAndClose(filePath, data, false, GBK);
            return;
        }

        String title = CsvUtil.toCsvString(titles);
        WriterUtil.writeLinesAndClose(filePath, false, GBK, new Object[] { title, data });
    }

}