line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Object; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use YAOO; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
272
|
use Scalar::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'ODS::Table::Column::Base'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use ODS::Utils qw/clone error deep_unblessed/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has reference => isa(boolean), default => 0; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has blessed => isa(boolean), default => 0; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has object_class => isa(string); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has serialize_class => isa(object); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub validation { |
20
|
6
|
|
|
6
|
0
|
54
|
my ($self, $value) = @_; |
21
|
6
|
100
|
50
|
|
|
47
|
if (ref($value || "SCALAR") =~ m/ARRAY|HASH|SCALAR/) { |
22
|
4
|
|
|
|
|
13
|
$value = $self->object_class->instantiate($self, 0, $value); |
23
|
4
|
|
|
|
|
13
|
$self->blessed(1); |
24
|
|
|
|
|
|
|
} |
25
|
6
|
|
|
|
|
120
|
return $value; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub inflation { |
29
|
4
|
|
|
4
|
0
|
39
|
my ($self, $value) = @_; |
30
|
|
|
|
|
|
|
|
31
|
4
|
50
|
|
|
|
20
|
if (! ref $value) { |
32
|
0
|
|
|
|
|
0
|
$value = $self->serialize_class->parse($value); |
33
|
0
|
|
|
|
|
0
|
$self->reference(1); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
4
|
50
|
|
|
|
31
|
return ref($value) =~ m/HASH|ARRAY|SCALAR/ ? do { |
37
|
4
|
|
|
|
|
18
|
$self->blessed(1); |
38
|
4
|
|
|
|
|
126
|
$value = $self->object_class->instantiate($self, 0, $value); |
39
|
4
|
|
|
|
|
10
|
$value; |
40
|
|
|
|
|
|
|
} : $value; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub deflation { |
44
|
4
|
|
|
4
|
0
|
35
|
my ($self, $value) = @_; |
45
|
4
|
50
|
|
|
|
8
|
if ($self->blessed) { |
46
|
4
|
|
|
|
|
45
|
$value = deep_unblessed $value; |
47
|
|
|
|
|
|
|
} |
48
|
4
|
50
|
33
|
|
|
15
|
if ($self->reference && ref $value) { |
49
|
0
|
|
|
|
|
0
|
$value = $self->serialize_class->stringify($value); |
50
|
|
|
|
|
|
|
} |
51
|
4
|
|
|
|
|
44
|
return $value; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |