Mercurial > pub > Impl
view Lib/IMPL/Object/PublicSerializable.pm @ 304:2ff513227cb4
*TTView: refactoring. Added control registry for the document.
author | cin |
---|---|
date | Mon, 15 Apr 2013 07:44:50 +0400 |
parents | 8088779e539d |
children |
line wrap: on
line source
package IMPL::Object::PublicSerializable; use strict; use IMPL::Const qw(:access); sub restore { my ($class,$data,$refSurrogate) = @_; if ($refSurrogate) { $refSurrogate->callCTOR(@$data); return $refSurrogate; } else { return $class->new(@$data); } } sub save { my ($this,$ctx) = @_; my %seen; my $val; defined($val = $this->$_()) and $ctx->AddVar($_,$val) foreach map $_->name,$this->GetMeta( 'IMPL::Class::PropertyInfo', sub { $_->access == ACCESS_PUBLIC and $_->getter and $_->setter and not $_->ownerSet and not $seen{$_->name} ++ }, 1 ); } 1;