FileUtil
下面展示一些 内联代码片
。
@Component
@Order(2)
public class FileUtil implements CommandLineRunner {
public static Entity entity;
// 共通漢字テーブル
public static HashSet<String> commonKanjiTable = new HashSet<String>();
// 日立漢字テーブル
public static HashSet<String> hitachiKanjiTable = new HashSet<String>();
// IBM漢字テーブル
public static HashSet<String> ibmTable = new HashSet<String>();
// 文字リスト
public static Map<String, String> characterListMap = new LinkedHashMap<String, String>();
// 基本休日
public static Map<String, String> daysOffTable = new LinkedHashMap<String, String>();
// 祝日、祝日が日曜日の翌日
public static LinkedList<String> daysOffAllTable = new LinkedList<String>();
// 年号
public static LinkedList<String> adToJapanTable = new LinkedList<String>();
static {
characterListMap.put(String.valueOf((byte) 177), "ア");
//此处省略
}
/**
* クラスのロード
*
* @throws Exception
*
*
*/
@Override
public void run(String... args) throws Exception {
xmlLoadInfo();
xmlDaysOffLoadInfo();
daysOffAllTable();
xmlAdToJapaneseCalendar();
}
/**
* config情報を取得する
*
* @throws FileNotFoundException
* @throws IOException
*
*/
private static void xmlLoadInfo() throws FileNotFoundException {
File file = ResourceUtils.getFile(entity.getConfigPath() + entity.getKanjiPath());
String userDir = System.getProperty("user.dir");
System.out.println("userDir : " + userDir);
SAXReader domReader = new SAXReader();
Document document;
try {
document = domReader.read(file);
Element rootElement = document.getRootElement();
for (Iterator<Element> i = rootElement.elementIterator(); i.hasNext();) {
Element element = (E