comparison Lib/IMPL/Class/PropertyInfo.pm @ 278:4ddb27ff4a0b

core refactoring
author cin
date Mon, 04 Feb 2013 02:10:37 +0400
parents 6253872024a4
children
comparison
equal deleted inserted replaced
277:6585464c4664 278:4ddb27ff4a0b
1 package IMPL::Class::PropertyInfo; 1 package IMPL::Class::PropertyInfo;
2 use strict; 2 use strict;
3 3
4 use parent qw(IMPL::Class::MemberInfo); 4 BEGIN {
5 our @ISA = qw(IMPL::Class::MemberInfo);
6 }
7
8 require IMPL::Class::MemberInfo;
5 9
6 our %CTOR = ( 'IMPL::Class::MemberInfo' => '@_' ); 10 our %CTOR = ( 'IMPL::Class::MemberInfo' => '@_' );
7 11
8 __PACKAGE__->mk_accessors(qw(type mutators canGet canSet ownerSet isList)); 12 __PACKAGE__->mk_accessors(
9 13 qw(
10 my %LoadedModules; 14 type
11 15 getter
12 sub CTOR { 16 setter
13 my $this = shift; 17 ownerSet
14 18 isList
15 if ( my $type = $this->attributes ? delete $this->attributes->{type} : undef ) { 19 )
16 $this->type($type); 20 );
17 }
18
19 $this->mutators(0) unless defined $this->mutators;
20 }
21
22 sub implementor {
23 my $this = shift;
24
25 if (@_) {
26 $this->SUPER::implementor(@_);
27 } else {
28 my $implementor = $this->SUPER::implementor;
29 return $implementor if $implementor;
30
31 $implementor = $this->SelectImplementor();
32
33 $this->implementor($implementor);
34 }
35
36 }
37
38 sub SelectImplementor {
39 eval {$_[0]->class->_PropertyImplementor} or die new IMPL::Exception('Can\'t find a property implementor for the specified class',$_[0]->Class);
40 }
41
42 1; 21 1;
43 22
44 __END__ 23 __END__
45 24
46 =pod 25 =pod