annotate Lib/IMPL/Class/Property/Base.pm @ 245:7c517134c42f

Added Unsupported media type Web exception corrected resourceLocation setting in the resource Implemented localizable resources for text messages fixed TT view scopings, INIT block in controls now sets globals correctly.
author sergey
date Mon, 29 Oct 2012 03:15:22 +0400
parents 6d8092d8ce1b
children 6253872024a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
1 package IMPL::Class::Property::Base;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
2 use strict;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
3
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
4 use IMPL::Const qw(:all);
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
5
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 59
diff changeset
6 sub factoryParams { qw($class $name $set $get $validator) };
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
7
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
8 my %factoryCache;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
9
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
10 my $accessor_get_no = 'die new IMPL::Exception(\'The property is write only\',$name,$class) unless $get;';
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
11 my $accessor_set_no = 'die new IMPL::Exception(\'The property is read only\',$name,$class) unless $set;';
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
12
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
13 my $custom_accessor_get = 'unshift @_, $this and goto &$get;';
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
14 my $custom_accessor_set = 'unshift @_, $this and goto &$set;';
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
15
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
16 my $validator_code = '$this->$validator(@_);';
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
17
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
18 my %access_code = (
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
19 ACCESS_PUBLIC , "",
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
20 ACCESS_PROTECTED, "die new IMPL::Exception('Can\\'t access the protected member',\$name,\$class,scalar caller) unless UNIVERSAL::isa(scalar caller,\$class);",
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
21 ACCESS_PRIVATE, "die new IMPL::Exception('Can\\'t access the private member',\$name,\$class,scalar caller) unless caller eq \$class;"
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
22 );
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
23
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
24 my $virtual_call = q(
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
25 my $method = $this->can($name);
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
26 return $this->$method(@_) unless $method == $accessor or caller->isa($class);
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
27 );
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
28
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
29 my $owner_check = "die new IMPL::Exception('Set accessor is restricted to the owner',\$name,\$class,scalar caller) unless caller eq \$class;";
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
30
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
31 sub GenerateAccessors {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
32 my ($self,$param,@params) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
33
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
34 my %accessors;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
35
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
36 if (not ref $param) {
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
37 if ($param & PROP_LIST) {
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
38 $accessors{get} = ($param & PROP_GET) ? $self->GenerateGetList(@params) : undef;
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
39 $accessors{set} = ($param & PROP_SET) ? $self->GenerateSetList(@params) : undef;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
40 } else {
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
41 $accessors{get} = ($param & PROP_GET) ? $self->GenerateGet(@params) : undef;
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
42 $accessors{set} = ($param & PROP_SET) ? $self->GenerateSet(@params) : undef;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
43 }
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
44 $accessors{owner} = (($param & PROP_OWNERSET) == PROP_OWNERSET) ? $owner_check : "";
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
45 } elsif (UNIVERSAL::isa($param,'HASH')) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
46 $accessors{get} = $param->{get} ? $custom_accessor_get : undef;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
47 $accessors{set} = $param->{set} ? $custom_accessor_set : undef;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
48 $accessors{owner} = "";
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
49 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
50 die new IMPL::Exception('The unsupported accessor/mutators supplied',$param);
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
51 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
52
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
53 return \%accessors;
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
54 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
55
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
56 sub GenerateSet {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
57 die new IMPL::Exception("Standard accessors not supported",'Set');
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
58 }
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
59
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
60 sub GenerateGet {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
61 die new IMPL::Exception("Standard accessors not supported",'Get');
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
62 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
63
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
64 sub GenerateGetList {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
65 die new IMPL::Exception("Standard accessors not supported",'GetList');
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
66 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
67
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
68 sub GenerateSetList {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
69 my ($self) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
70 die new IMPL::Exception("Standard accessors not supported",'SetList');
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
71 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
72
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
73 sub Make {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
74 my ($self,$propInfo) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
75
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
76 my $key = $self->MakeFactoryKey($propInfo);
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
77
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
78 my $factoryInfo = $factoryCache{$key};
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
79
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
80 unless ($factoryInfo) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
81 my $mutators = $self->GenerateAccessors($propInfo->Mutators);
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
82 $factoryInfo = {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
83 factory => $self->CreateFactory(
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
84 $access_code{ $propInfo->Access },
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
85 $propInfo->Attributes->{validator} ? $validator_code : "",
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
86 $mutators->{owner},
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
87 $mutators->{get} || $accessor_get_no,
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
88 $mutators->{set} || $accessor_set_no
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
89 ),
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
90 mutators => $mutators
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
91 };
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
92 $factoryCache{$key} = $factoryInfo;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
93 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
94
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
95 {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
96 no strict 'refs';
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
97 *{ $propInfo->Class.'::'.$propInfo->Name } = $factoryInfo->{factory}->($self->RemapFactoryParams($propInfo));
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
98 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
99
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
100 my $mutators = $factoryInfo->{mutators};
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
101
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
102 $propInfo->canGet( $mutators->{get} ? 1 : 0 );
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
103 $propInfo->canSet( $mutators->{set} ? 1 : 0 );
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
104 $propInfo->ownerSet( $mutators->{owner} );
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
105
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
106 1;
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
107 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
108
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
109 sub Implement {
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
110 my ($self,$spec) = @_;
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
111 }
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 194
diff changeset
112
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
113 # extract from property info: class, name, get_accessor, set_accessor, validator
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
114 sub RemapFactoryParams {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
115 my ($self,$propInfo) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
116
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
117 my $mutators = $propInfo->Mutators;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
118 my $class = $propInfo->Class;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
119 my $validator = $propInfo->Attributes->{validator};
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
120
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
121 die new IMPL::Exception('Can\'t find the specified validator',$class,$validator) if $validator and ref $validator ne 'CODE' and not $class->can($validator);
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
122
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
123 return (
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
124 $propInfo->get(qw(Class Name)),
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
125 (ref $mutators?
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
126 ($mutators->{set},$mutators->{get})
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
127 :
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
128 (undef,undef)
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
129 ),
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
130 $validator
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
131 );
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
132 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
133
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
134 sub MakeFactoryKey {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
135 my ($self,$propInfo) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
136
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
137 my ($access,$mutators,$validator) = ($propInfo->get(qw(Access Mutators)),$propInfo->Attributes->{validator});
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
138
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
139 my $implementor = ref $self || $self;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
140
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
141 return join ('',
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
142 $implementor,
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
143 $access,
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
144 $validator ? 'v' : 'n',
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
145 ref $mutators ?
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
146 ('c' , $mutators->{get} ? 1 : 0, $mutators->{set} ? 1 : 0)
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
147 :
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
148 ('s',$mutators)
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
149 );
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
150 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
151
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
152 sub CreateFactory {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
153 my ($self,$codeAccessCheck,$codeValidator,$codeOwnerCheck,$codeGet,$codeSet) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
154
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
155 my $strParams = join(',',$self->factoryParams);
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
156
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
157 my $factory = <<FACTORY;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
158
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
159 sub {
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
160 my ($strParams) = \@_;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
161 my \$accessor;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
162 \$accessor = sub {
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
163 my \$this = shift;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
164 $codeAccessCheck
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
165 if (\@_) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
166 $codeOwnerCheck
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
167 $codeValidator
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
168 $codeSet
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
169 } else {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
170 $codeGet
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
171 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
172 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
173 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
174 FACTORY
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
175
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
176 return ( eval $factory or die new IMPL::Exception("Syntax error due compiling the factory","$@") );
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
177 }
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
178
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
179 1;
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
180
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
181 __END__
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
182
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
183 =pod
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
184
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
185 =head1 DESCRIPTION
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
186
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
187 Базовый класс для реализации свойств.
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
188
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
189 По существу свойства состоят из двух методов для установки и получения значений. Также
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
190 существует несколько вариантов доступа к свойству, и метод верификации значения. Еще
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
191 свойства могут быть виртуальными.
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
192
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
193 Для создания реализатора свойств достаточно унаследовать от этого класса и описать
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
194 методы для генерации кода получения и установки значения.
80
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
195
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
196 =head1 MEMBERS
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
197
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
198 =over
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
199
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
200 =item C<Make($propertyInfo)>
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
201
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
202 Создает свойство у класса, на основе C<$propertyInfo>, описывающего свойство. C<IMPL::Class::PropertyInfo>.
80
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
203
f017c0d7527c minor changes + docs
wizard
parents: 63
diff changeset
204 =back
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
diff changeset
205
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 134
diff changeset
206 =cut