comparison Lib/IMPL/Class/Property/Accessor.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children 6253872024a4
comparison
equal deleted inserted replaced
193:8e8401c0aea4 194:4d0e1962161c
1 package IMPL::Class::Property::Accessor; 1 package IMPL::Class::Property::Accessor;
2 use strict; 2 use strict;
3 use parent qw(IMPL::Class::Property::Base); 3 use parent qw(IMPL::Class::Property::Base);
4 4
5 sub factoryParams { 5 sub factoryParams {
6 $_[0]->SUPER::factoryParams, qw($field); 6 $_[0]->SUPER::factoryParams, qw($field);
7 } 7 }
8 8
9 sub RemapFactoryParams { 9 sub RemapFactoryParams {
10 my ($self,$propInfo) = @_; 10 my ($self,$propInfo) = @_;
11 11
12 return $self->SUPER::RemapFactoryParams($propInfo),$propInfo->Name; 12 return $self->SUPER::RemapFactoryParams($propInfo),$propInfo->Name;
13 } 13 }
14 14
15 sub GenerateGet { 15 sub GenerateGet {
16 'return $this->get($field);'; 16 'return $this->get($field);';
17 } 17 }
18 18
19 sub GenerateSet { 19 sub GenerateSet {
20 'return $this->set($field,@_);'; 20 'return $this->set($field,@_);';
21 } 21 }
22 22
23 sub GenerateSetList { 23 sub GenerateSetList {
24 'my $val = IMPL::Object::List->new( (@_ == 1 and UNIVERSAL::isa($_[0], \'ARRAY\') ) ? $_[0] : [@_] ); 24 'my $val = IMPL::Object::List->new( (@_ == 1 and UNIVERSAL::isa($_[0], \'ARRAY\') ) ? $_[0] : [@_] );
25 $this->set($field,$val); 25 $this->set($field,$val);
26 return( wantarray ? @{ $val } : $val );'; 26 return( wantarray ? @{ $val } : $val );';
27 } 27 }
28 28
29 sub GenerateGetList { 29 sub GenerateGetList {
30 'my $val = $this->get($field); 30 'my $val = $this->get($field);
31 $this->set($field,$val = IMPL::Object::List->new()) unless $val; 31 $this->set($field,$val = IMPL::Object::List->new()) unless $val;
32 return( wantarray ? @{ $val } : $val );'; 32 return( wantarray ? @{ $val } : $val );';
33 } 33 }
34 34
35 1; 35 1;