Mercurial > pub > Impl
annotate Lib/IMPL/Class/Property/Accessor.pm @ 216:e9fd7ff3f54c
sync
author | sergey |
---|---|
date | Thu, 09 Aug 2012 17:24:07 +0400 |
parents | 4d0e1962161c |
children | 6253872024a4 |
rev | line source |
---|---|
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
1 package IMPL::Class::Property::Accessor; |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
2 use strict; |
165 | 3 use parent qw(IMPL::Class::Property::Base); |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
4 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
5 sub factoryParams { |
194 | 6 $_[0]->SUPER::factoryParams, qw($field); |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
7 } |
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 sub RemapFactoryParams { |
194 | 10 my ($self,$propInfo) = @_; |
11 | |
12 return $self->SUPER::RemapFactoryParams($propInfo),$propInfo->Name; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
13 } |
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 sub GenerateGet { |
194 | 16 'return $this->get($field);'; |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
17 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
18 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
19 sub GenerateSet { |
194 | 20 'return $this->set($field,@_);'; |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
21 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
22 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
23 sub GenerateSetList { |
194 | 24 'my $val = IMPL::Object::List->new( (@_ == 1 and UNIVERSAL::isa($_[0], \'ARRAY\') ) ? $_[0] : [@_] ); |
25 $this->set($field,$val); | |
26 return( wantarray ? @{ $val } : $val );'; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
27 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
28 |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
29 sub GenerateGetList { |
194 | 30 'my $val = $this->get($field); |
31 $this->set($field,$val = IMPL::Object::List->new()) unless $val; | |
32 return( wantarray ? @{ $val } : $val );'; | |
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
33 } |
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
diff
changeset
|
34 |
180 | 35 1; |