line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::GData::Node::AbstractEntity; |
2
|
19
|
|
|
19
|
|
5596
|
use WebService::GData 'private'; |
|
19
|
|
|
|
|
46
|
|
|
19
|
|
|
|
|
127
|
|
3
|
19
|
|
|
19
|
|
142
|
use base 'WebService::GData'; |
|
19
|
|
|
|
|
74
|
|
|
19
|
|
|
|
|
17790
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = 0.01_03; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
5
|
sub __init {} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub swap { |
11
|
0
|
|
|
0
|
0
|
0
|
my($this,$remove,$new)=@_; |
12
|
0
|
|
|
|
|
0
|
my $nodename = ref($remove); |
13
|
0
|
|
|
|
|
0
|
$this->_entity->swap($remove,$new); |
14
|
0
|
|
|
|
|
0
|
$nodename=~s/.*:://; |
15
|
0
|
|
|
|
|
0
|
$this->{"_\l$nodename"}=$new; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _entity { |
19
|
388
|
|
|
388
|
|
911
|
my $this = shift; |
20
|
388
|
100
|
|
|
|
862
|
if(@_==1){ |
21
|
24
|
|
|
|
|
1726
|
$this->{_entity}=shift; |
22
|
|
|
|
|
|
|
} |
23
|
388
|
|
|
|
|
3648
|
return $this->{_entity}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub __set { |
28
|
23
|
|
|
23
|
|
52
|
my ($this,$func,$val)= @_; |
29
|
23
|
|
|
|
|
42
|
my $public =$func; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#all the wrapper methods store the original Node objects |
32
|
|
|
|
|
|
|
#by prefixing the tag name with _ |
33
|
23
|
|
|
|
|
42
|
$func='_'.$func; |
34
|
23
|
100
|
|
|
|
219
|
if($this->{$func}){ |
35
|
22
|
50
|
|
|
|
73
|
if(ref($this->{$func})){ |
36
|
22
|
100
|
|
|
|
105
|
$this->{$func}->{text}=$val if(!ref $val); |
37
|
22
|
|
|
|
|
170
|
return $this->{$func}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
0
|
|
|
|
|
0
|
$this->{$func}=$val; |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
0
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
1
|
|
|
|
|
3
|
my $code = $this->_entity->can($public); |
45
|
1
|
50
|
|
|
|
4
|
if($code){ |
46
|
0
|
|
|
|
|
0
|
$code->($this,$val); |
47
|
0
|
|
|
|
|
0
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
1
|
|
|
|
|
3
|
$this->_entity->__set($public,$val); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub __get { |
55
|
184
|
|
|
184
|
|
303
|
my ($this,$func)= @_; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
184
|
100
|
|
|
|
388
|
return $this->_entity->$func() if($this->_entity->can($func)); |
59
|
|
|
|
|
|
|
|
60
|
149
|
|
|
|
|
249
|
my $public =$func; |
61
|
149
|
|
|
|
|
325
|
$func='_'.$func; |
62
|
|
|
|
|
|
|
|
63
|
149
|
100
|
66
|
|
|
862
|
if($this->{$func} && ref($this->{$func})=~m/WebService/){ |
64
|
|
|
|
|
|
|
|
65
|
142
|
100
|
|
|
|
1508
|
return $this->{$func} if ref($this->{$func})=~m/array|collection/i; |
66
|
|
|
|
|
|
|
|
67
|
66
|
100
|
|
|
|
96
|
if(@{$this->{$func}->attributes}==0){ |
|
66
|
|
|
|
|
546
|
|
68
|
|
|
|
|
|
|
|
69
|
47
|
|
|
|
|
186
|
_install_get_set_text(ref $this,$public,$func); |
70
|
47
|
50
|
|
|
|
11140
|
return $this->{$func}->{text} ? $this->{$func}->{text}:$this->{$func}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
19
|
|
66
|
|
|
172
|
return $this->{$func}->{text}||$this->{$func}; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
7
|
50
|
|
|
|
39
|
return $this->_entity->$public() if($this->_entity->__get($public)); |
79
|
0
|
0
|
|
|
|
0
|
return $this->_entity->{$public} if($this->_entity->{$public}); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
private _install_get_set_text=>sub { |
85
|
|
|
|
|
|
|
my ($package,$called_func,$stored_attr)=@_; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
{ |
88
|
19
|
|
|
19
|
|
138
|
no strict 'refs'; |
|
19
|
|
|
|
|
35
|
|
|
19
|
|
|
|
|
2928
|
|
89
|
|
|
|
|
|
|
*{$package.'::'.$called_func}= sub { |
90
|
19
|
|
|
19
|
|
38
|
my ($this,$text) = @_; |
91
|
19
|
|
|
|
|
67
|
local *__ANON__=$called_func; |
92
|
19
|
100
|
|
|
|
54
|
if($text){ |
93
|
5
|
|
|
|
|
45
|
return $this->{ $stored_attr }->text($text); |
94
|
|
|
|
|
|
|
} |
95
|
14
|
50
|
|
|
|
91
|
$this->{ $stored_attr }->text||$this->{ $stored_attr }; |
96
|
|
|
|
|
|
|
}; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
"The earth is blue like an orange."; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
__END__ |