| 
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 
 | 
| 
274
 | 
     8 __PACKAGE__->mk_accessors(qw(Type Mutators canGet canSet ownerSet isList));
 | 
| 
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 
 | 
| 
274
 | 
    42 sub type {
 | 
| 
 | 
    43     goto &Type;
 | 
| 
 | 
    44 }
 | 
| 
 | 
    45 
 | 
| 
49
 | 
    46 1;
 | 
| 
180
 | 
    47 
 | 
| 
 | 
    48 __END__
 | 
| 
 | 
    49 
 | 
| 
 | 
    50 =pod
 | 
| 
 | 
    51 
 | 
| 
209
 | 
    52 =head1 NAME
 | 
| 
 | 
    53 
 | 
| 
 | 
    54 C<IMPL::Class::PropertyInfo> - метаданные о свойствах объектов. Используются для отражения и
 | 
| 
 | 
    55 проверки данных объектов.
 | 
| 
 | 
    56 
 | 
| 
 | 
    57 =head1 DESCRIPTION
 | 
| 
 | 
    58 
 | 
| 
 | 
    59 В зависимости от типа каждый объект предоставляет способ хранения данных, например хеши позволяют
 | 
| 
 | 
    60 хранить состояние в виде ассоциативного массива и т.д. Информация о свойстве предоставляет определенный
 | 
| 
 | 
    61 уровень абстракции. 
 | 
| 
 | 
    62 
 | 
| 
180
 | 
    63 =cut
 |