Mercurial > pub > Impl
comparison Lib/IMPL/Class/Property/Direct.pm @ 52:15d720913562
security in work
author | wizard@linux-odin.local |
---|---|
date | Tue, 02 Mar 2010 20:12:02 +0300 |
parents | 16ada169ca75 |
children | 609b59c9f03c |
comparison
equal
deleted
inserted
replaced
51:a1498298d3ee | 52:15d720913562 |
---|---|
20 | 20 |
21 my $accessor_get_no = 'die new IMPL::Exception(\'The property is write only\',$name,$class) unless $get;'; | 21 my $accessor_get_no = 'die new IMPL::Exception(\'The property is write only\',$name,$class) unless $get;'; |
22 my $accessor_set_no = 'die new IMPL::Exception(\'The property is read only\',$name,$class) unless $set;'; | 22 my $accessor_set_no = 'die new IMPL::Exception(\'The property is read only\',$name,$class) unless $set;'; |
23 my $accessor_set = 'return( $this->{$field} = @_ == 1 ? $_[0] : [@_] );'; | 23 my $accessor_set = 'return( $this->{$field} = @_ == 1 ? $_[0] : [@_] );'; |
24 my $accessor_get = 'return( $this->{$field} );'; | 24 my $accessor_get = 'return( $this->{$field} );'; |
25 my $list_accessor_set = 'return( @{ ($this->{$field} = ( (@_ == 1 and ref $_[0] eq \'ARRAY\') ? $_[0] : [@_] ) || [] ) } );'; | 25 my $list_accessor_set = 'return( @{ ($this->{$field} = IMPL::Object::List->new( ( (@_ == 1 and ref $_[0] eq \'ARRAY\') ? $_[0] : [@_] ) || [] ) } );'; |
26 my $list_accessor_get = 'return( @{ $this->{$field} || [] } );'; | 26 my $list_accessor_get = 'return( @{ $this->{$field} ? $this->{$field} : $this->{$field} = IMPL::Object::List->new() } );'; |
27 my $custom_accessor_get = 'unshift @_, $this and goto &$get;'; | 27 my $custom_accessor_get = 'unshift @_, $this and goto &$get;'; |
28 my $custom_accessor_set = 'unshift @_, $this and goto &$set;'; | 28 my $custom_accessor_set = 'unshift @_, $this and goto &$set;'; |
29 | 29 |
30 my %accessor_cache; | 30 my %accessor_cache; |
31 sub mk_acessor { | 31 sub mk_acessor { |