P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package foundation.data.meta.property;
 
import foundation.dao.OperatorCode;
import foundation.util.Util;
 
public enum MetaType {
 
    List, Form, Export, Import, Unknow, None;
 
    public static MetaType getInstance(String order, OperatorCode operatorCode) {
        MetaType result = Unknow;
        
        if (!Util.isEmpty(order)) {
            result = parse(order);
            return result;
        }
        
         if (OperatorCode.GetBatch == operatorCode) {
             result = MetaType.List;
         }
         else if (OperatorCode.GetOne == operatorCode) {
             result = MetaType.Form;
         }
        
        return result;
    }
    
    public static MetaType parse(String value) {
        if (value == null) {
            return Unknow;
        }
        
        value = value.toLowerCase();
 
        if ("list".equals(value)) {
            return List;
        }
        else if ("form".equals(value)) {
            return Form;
        }
        
        return Unknow;
    }
    
}