Mercurial > pub > Impl
annotate Lib/IMPL/Object/PublicSerializable.pm @ 294:8088779e539d
corrected IMPL::Config::Activator
author | cin |
---|---|
date | Thu, 28 Feb 2013 02:19:38 +0400 |
parents | 4ddb27ff4a0b |
children |
rev | line source |
---|---|
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
1 package IMPL::Object::PublicSerializable; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
2 use strict; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
3 |
278 | 4 use IMPL::Const qw(:access); |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
5 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
6 sub restore { |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
7 my ($class,$data,$refSurrogate) = @_; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
8 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
9 if ($refSurrogate) { |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
10 $refSurrogate->callCTOR(@$data); |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
11 return $refSurrogate; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
12 } else { |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
13 return $class->new(@$data); |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
14 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
15 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
16 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
17 sub save { |
194 | 18 my ($this,$ctx) = @_; |
19 | |
20 my %seen; | |
21 | |
22 my $val; | |
23 | |
24 defined($val = $this->$_()) and $ctx->AddVar($_,$val) foreach | |
278 | 25 map $_->name,$this->GetMeta( |
194 | 26 'IMPL::Class::PropertyInfo', |
27 sub { | |
278 | 28 $_->access == ACCESS_PUBLIC and |
29 $_->getter and | |
294 | 30 $_->setter and |
194 | 31 not $_->ownerSet and |
278 | 32 not $seen{$_->name} ++ |
194 | 33 }, |
34 1 | |
35 ); | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
36 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
37 |
180 | 38 1; |