Mercurial > pub > Impl
annotate Lib/IMPL/Class/PropertyInfo.pm @ 265:6b6d4b2275a1
improved documentation
| author | cin |
|---|---|
| date | Thu, 10 Jan 2013 03:25:02 +0400 |
| parents | 6d8092d8ce1b |
| children | 8d36073411b1 |
| rev | line source |
|---|---|
| 49 | 1 package IMPL::Class::PropertyInfo; |
| 2 use strict; | |
| 3 | |
| 228 | 4 use parent qw(IMPL::Class::MemberInfo); |
| 5 | |
| 6 our %CTOR = ( 'IMPL::Class::MemberInfo' => '@_' ); | |
| 49 | 7 |
|
60
b0c068da93ac
Lazy activation for the configuration objects (final concept)
wizard
parents:
49
diff
changeset
|
8 __PACKAGE__->mk_accessors(qw(Type Mutators canGet canSet ownerSet)); |
| 49 | 9 |
| 10 my %LoadedModules; | |
| 11 | |
| 12 sub CTOR { | |
| 13 my $this = shift; | |
| 14 | |
| 15 if ( my $type = $this->Attributes ? delete $this->Attributes->{type} : undef ) { | |
| 16 $this->Type($type); | |
| 17 } | |
| 18 | |
| 19 $this->Mutators(0) unless defined $this->Mutators; | |
| 20 } | |
| 21 | |
| 22 sub Implementor { | |
| 23 my $this = shift; | |
| 134 | 24 |
| 49 | 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 { | |
| 134 | 39 eval {$_[0]->Class->_PropertyImplementor} or die new IMPL::Exception('Can\'t find a property implementor for the specified class',$_[0]->Class); |
| 49 | 40 } |
| 41 | |
| 42 1; | |
| 180 | 43 |
| 44 __END__ | |
| 45 | |
| 46 =pod | |
| 47 | |
| 209 | 48 =head1 NAME |
| 49 | |
| 50 C<IMPL::Class::PropertyInfo> - метаданные о свойствах объектов. Используются для отражения и | |
| 51 проверки данных объектов. | |
| 52 | |
| 53 =head1 DESCRIPTION | |
| 54 | |
| 55 В зависимости от типа каждый объект предоставляет способ хранения данных, например хеши позволяют | |
| 56 хранить состояние в виде ассоциативного массива и т.д. Информация о свойстве предоставляет определенный | |
| 57 уровень абстракции. | |
| 58 | |
| 180 | 59 =cut |
