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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package foundation.data.meta.property;
 
import java.util.Date;
 
import foundation.data.meta.field.Field;
import foundation.data.meta.template.Indexes;
import foundation.data.object.DataObject;
import foundation.util.MapList;
 
public class MetasDefaultSet extends IPropertyMetasSet {
    
 
    public MetasDefaultSet(Indexes indexes) {
        super(indexes);
        
        level = Level.Default;
        exportPropertys = new PropertysRuntime(indexes.getExportableIndex());
        importPropertys = new PropertysRuntime(indexes.getImportableIndex()) ;
    }
    
    public void build(DataObject dataObject) throws Exception {
        MapList<String, Field> fieldMetas = dataObject.getBrowseFieldMetas();
        Field field;
        
        for (Property property: this) {
            field = fieldMetas.get(property.getFieldName());
                    
            if (field == null) {
                continue;
            }
            
            property.setField(field);
        }
        
        initialized = true;
        loadLastTime = new Date();
    }
    
    public void loadOne(Property meta) {
        String fieldName = meta.getFieldName();
        
        //1. 添加到全量列表中
        allItems.add(fieldName, meta);
        
        //2. 如果是List,加入到List列表中
        if (meta.isList()) {
            listPropertys.add(fieldName, meta);    
        }
        
        //3. 如果是Form,加入到Form列表中
        if (meta.isForm()) {
            formPropertys.add(fieldName, meta);    
        }
        
        //4. 如果是Form,加入到Form列表中
        if (meta.isExportalbe()) {
            exportPropertys.add(fieldName, meta);    
        }
        
        //5. 如果是Form,加入到Form列表中
        if (meta.isImportable()) {
            importPropertys.add(fieldName, meta);    
        }
    }
 
    @Override
    public void saveChange() throws Exception {
    }
    
    @Override
    protected void initExportPropertys() {
    }
 
}