package com.yfd.platform.annotation.impl;



import com.yfd.platform.annotation.StorageParamItem;
import com.yfd.platform.annotation.StorageParamSelect;
import com.yfd.platform.modules.storage.model.bo.StorageSourceParamDef;
import com.yfd.platform.modules.storage.model.param.IStorageParam;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

/**
 * 编码格式动态参数.
 *
 * @author zhengsl
 */
public class EncodingStorageParamSelect implements StorageParamSelect {

	@Override
	public List<StorageSourceParamDef.Options> getOptions(StorageParamItem storageParamItem, IStorageParam targetParam) {
		List<StorageSourceParamDef.Options> options = new ArrayList<>();

		for (String name : Charset.availableCharsets().keySet()) {
			StorageSourceParamDef.Options option = new StorageSourceParamDef.Options(name);
			options.add(option);
		}
		return options;
	}

}
