annotate Lib/IMPL/Class/MemberInfo.pm @ 276:8a5da17d7ef9

*IMPL::Class refactoring property definition mechanism (incomplete).
author sergey
date Thu, 31 Jan 2013 17:37:44 +0400
parents 6253872024a4
children 4ddb27ff4a0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
1 package IMPL::Class::MemberInfo;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
2 use strict;
165
76515373dac0 Added Class::Template,
wizard
parents: 163
diff changeset
3 use parent qw(IMPL::Object::Accessor);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
4
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
5 require IMPL::Exception;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
6
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
7 __PACKAGE__->mk_accessors(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
8 qw(
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
9 name
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
10 access
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
11 class
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
12 implementor
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
13 attributes
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
14 )
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
15 );
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
16 __PACKAGE__->PassThroughArgs;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
17
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
18 sub CTOR {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
19 my $this = shift;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
20
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
21 die new IMPL::Exception('The name is required for the member') unless $this->name;
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
22 die new IMPL::Exception('The class is required for the member') unless $this->class;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
23
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
24 $this->attributes({}) unless defined $this->attributes;
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
25 $this->access(3) unless $this->access;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
26 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
28 sub Implement {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
29 my ($this) = @_;
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
30 $this->implementor->Make($this);
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
31 $this->class->set_meta($this);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
32 return;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
33 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
34
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
35 1;
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
36
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
37 __END__
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
38
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
39 =pod
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
40
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
41 =head1 NAME
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
42
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
43 C<IMPL::Class::MemberInfo> - информация о члене класса.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
44
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
45 =head1 DESCRIPTION
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
46
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
47 Данный класс является базовым для таких классов как C<IMPL::Class::PropertyInfo>, C<IMPL::Class::MethodInfo> и
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
48 предназначен для хренения метаданных.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
49
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
50 Данный класс наследуется от C<IMPL::Object::Accessor> и не содержит в себе метаданных о своих членах.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
51
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
52 =head1 MEMBERS
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
53
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
54 =over
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
55
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
56 =item C<[get,set] name>
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
57
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
58 Имя члена.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
59
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
60 =item C<[get,set] access>
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
61
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
62 Default public.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
63
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
64 Атрибут доступа ( public | private | protected )
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
65
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
66 =item C<[get,set] class>
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
67
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
68 Класс владелец
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
69
275
6253872024a4 *refactoring IMPL::Class
cin
parents: 236
diff changeset
70 =item C<[get,set] attributes>
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
71
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
72 Дополнительные атрибуты
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
73
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
74 =item C<Implement()>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
75
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
76 При реализации собственного субкласса, данный метод может быть переопределен для
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
77 реализации дополнительной обработки (например, создание методов доступа для свойств).
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
78
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
79 =back
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
80
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
81 =cut