1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.healthmarketscience.jackcess.impl;
18
19 import java.io.IOException;
20
21 import com.healthmarketscience.jackcess.PropertyMap;
22 import com.healthmarketscience.jackcess.complex.ComplexColumnInfo;
23 import com.healthmarketscience.jackcess.complex.ComplexDataType;
24 import com.healthmarketscience.jackcess.complex.ComplexValue;
25 import com.healthmarketscience.jackcess.impl.complex.ComplexColumnInfoImpl;
26 import com.healthmarketscience.jackcess.impl.complex.MultiValueColumnInfoImpl;
27 import com.healthmarketscience.jackcess.impl.complex.MultiValueColumnPropertyMap;
28
29
30
31
32
33
34
35 class ComplexColumnImpl extends ColumnImpl
36 {
37
38 private final ComplexColumnInfo<? extends ComplexValue> _complexInfo;
39
40 private PropertyMap _mvProps;
41
42 ComplexColumnImpl(InitArgs args) throws IOException
43 {
44 super(args);
45 _complexInfo = ComplexColumnSupport.create(this, args.buffer, args.offset);
46 }
47
48 @Override
49 void postTableLoadInit() throws IOException {
50 if(_complexInfo != null) {
51 ((ComplexColumnInfoImpl<? extends ComplexValue>)_complexInfo)
52 .postTableLoadInit();
53 }
54 super.postTableLoadInit();
55 }
56
57 @Override
58 public PropertyMap getProperties() throws IOException {
59 if(_complexInfo.getType() == ComplexDataType.MULTI_VALUE) {
60 if(_mvProps == null) {
61 PropertyMap primaryProps = super.getProperties();
62 PropertyMap complexProps = ((MultiValueColumnInfoImpl)_complexInfo)
63 .getValueColumn().getProperties();
64 _mvProps = new MultiValueColumnPropertyMap(primaryProps, complexProps);
65 }
66 return _mvProps;
67 }
68 return super.getProperties();
69 }
70
71 @Override
72 public ComplexColumnInfo<? extends ComplexValue> getComplexInfo() {
73 return _complexInfo;
74 }
75 }