Mercurial > pub > Impl
view Lib/IMPL/Class/PropertyInfo.pm @ 277:6585464c4664
sync (unstable)
author | sergey |
---|---|
date | Fri, 01 Feb 2013 16:37:59 +0400 |
parents | 6253872024a4 |
children | 4ddb27ff4a0b |
line wrap: on
line source
package IMPL::Class::PropertyInfo; use strict; use parent qw(IMPL::Class::MemberInfo); our %CTOR = ( 'IMPL::Class::MemberInfo' => '@_' ); __PACKAGE__->mk_accessors(qw(type mutators canGet canSet ownerSet isList)); my %LoadedModules; sub CTOR { my $this = shift; if ( my $type = $this->attributes ? delete $this->attributes->{type} : undef ) { $this->type($type); } $this->mutators(0) unless defined $this->mutators; } sub implementor { my $this = shift; if (@_) { $this->SUPER::implementor(@_); } else { my $implementor = $this->SUPER::implementor; return $implementor if $implementor; $implementor = $this->SelectImplementor(); $this->implementor($implementor); } } sub SelectImplementor { eval {$_[0]->class->_PropertyImplementor} or die new IMPL::Exception('Can\'t find a property implementor for the specified class',$_[0]->Class); } 1; __END__ =pod =head1 NAME C<IMPL::Class::PropertyInfo> - метаданные о свойствах объектов. Используются для отражения и проверки данных объектов. =head1 DESCRIPTION В зависимости от типа каждый объект предоставляет способ хранения данных, например хеши позволяют хранить состояние в виде ассоциативного массива и т.д. Информация о свойстве предоставляет определенный уровень абстракции. =cut