MCPcopy
hub / github.com/davyxu/tabtoy / main

Method main

v3/example/java/src/test/java/Main.java:14–41  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

12 return new String(Files.readAllBytes(Paths.get(fileName)));
13 }
14 public static void main(String[] args) throws Exception {
15
16 // 从文件读取配置表
17 String data = null;
18 try {
19 data = readFileAsString("./cfg/table_gen.json");
20 } catch (Exception e) {
21 e.printStackTrace();
22 }
23
24 // 表格数据
25 Table tab;
26
27 // 从json序列化出对象
28 tab = JSON.parseObject(data, Table.class);
29
30 if(tab == null){
31 throw new Exception("parse table failed");
32 }
33
34 // 构建索引
35 tab.BuildData();
36
37 // 测试输出
38 for(Map.Entry<Integer, Table.ExampleData> def : tab.ExampleDataByID.entrySet()){
39 System.out.println(def.getValue().Name);
40 }
41 }
42}

Callers

nothing calls this directly

Calls 3

readFileAsStringMethod · 0.95
BuildDataMethod · 0.95
getValueMethod · 0.80

Tested by

no test coverage detected