org.usc.file.operater.rules.ConvertFactory Maven / Gradle / Ivy
Show all versions of filename-batch-converter-main Show documentation
package org.usc.file.operater.rules;
/**
* 转换工厂
*
* @author ShunLi
* @notes Created on 2010-12-11
* Revision of last commit:$Revision: 1347 $
* Author of last commit:$Author: [email protected] $
* Date of last commit:$Date: 2011-09-05 23:30:42 +0800 (周一, 05 九月 2011) $
*
*/
public class ConvertFactory {
public static ConvertRule createConvertRule(Rule rule) {
ConvertRule cr = new SmallToBigConvertRule(); // Default
if (Rule.SmallToBig == rule) {
cr = new SmallToBigConvertRule();
} else if (Rule.BigToSmall == rule) {
cr = new BigToSmallConvertRule();
// cr = new SimpleBigToSmallConvertRule(); // simple 支持百一下的文件,快速一点
} else if (Rule.Prefix == rule) {
cr = new PrefixConvertRule();
} else if (Rule.Suffix == rule) {
cr = new SuffixConvertRule();
} else if (Rule.Replace == rule) {
cr = new ReplaceConvertRule();
}
return cr;
}
}