1 package Class::MOP::Deprecated;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
10 use Package::DeprecationManager -deprecations => {
11 'Class::MOP::HAVE_ISAREV' => '0.93',
12 'Class::MOP::subname' => '0.93',
13 'Class::MOP::in_global_destruction' => '0.93',
15 'Class::MOP::Package::get_method_map' => '0.93',
17 'Class::MOP::Class::construct_class_instance' => '0.93',
18 'Class::MOP::Class::check_metaclass_compatibility' => '0.93',
19 'Class::MOP::Class::create_meta_instance' => '0.93',
20 'Class::MOP::Class::clone_instance' => '0.93',
21 'Class::MOP::Class::alias_method' => '0.93',
22 'Class::MOP::Class::compute_all_applicable_methods' => '0.93',
23 'Class::MOP::Class::compute_all_applicable_attributes' => '0.93',
24 'Class::MOP::Class::get_attribute_map' => '0.95',
26 'Class::MOP::Instance::bless_instance_structure' => '0.93',
28 'Class::MOP::Attribute::process_accessors' => '0.93',
30 'Class::MOP::Method::Accessor::initialize_body' => '0.93',
31 'Class::MOP::Method::Accessor::generate_accessor_method' => '0.93',
32 'Class::MOP::Method::Accessor::generate_reader_method' => '0.93',
33 'Class::MOP::Method::Accessor::generate_writer_method' => '0.93',
34 'Class::MOP::Method::Accessor::generate_predicate_method' => '0.93',
35 'Class::MOP::Method::Accessor::generate_clearer_method' => '0.93',
36 'Class::MOP::Method::Accessor::generate_accessor_method_inline' => '0.93',
37 'Class::MOP::Method::Accessor::generate_reader_method_inline' => '0.93',
38 'Class::MOP::Method::Accessor::generate_writer_method_inline' => '0.93',
39 'Class::MOP::Method::Accessor::generate_clearer_method_inline' => '0.93',
40 'Class::MOP::Method::Accessor::generate_predicate_method_inline' =>
43 'Class::MOP::Method::Constructor::meta_instance' => '0.93',
44 'Class::MOP::Method::Constructor::attributes' => '0.93',
45 'Class::MOP::Method::Constructor::initialize_body' => '0.93',
46 'Class::MOP::Method::Constructor::generate_constructor_method' => '0.93',
47 'Class::MOP::Method::Constructor::generate_constructor_method_inline' =>
56 Class::MOP::Deprecated::deprecated(
57 "Class::MOP::HAVE_ISAREV is deprecated and will be removed in a future release. It has always returned 1 anyway."
63 Class::MOP::Deprecated::deprecated(
64 "Class::MOP::subname is deprecated. Please use Sub::Name directly.");
66 goto \&Sub::Name::subname;
69 sub in_global_destruction {
70 Class::MOP::Deprecated::deprecated(
71 "Class::MOP::in_global_destruction is deprecated. Please use Devel::GlobalDestruction directly."
73 require Devel::GlobalDestruction;
74 goto \&Devel::GlobalDestruction::in_global_destruction;
80 use Scalar::Util qw( blessed );
83 Class::MOP::Deprecated::deprecated(
84 'The get_method_map method has been made private.'
85 . " The public version is deprecated and will be removed in a future release.\n"
89 my $map = $self->_full_method_map;
91 $map->{$_} = $self->get_method($_)
92 for grep { !blessed( $map->{$_} ) } keys %{$map};
103 sub construct_class_instance {
104 Class::MOP::Deprecated::deprecated(
105 'The construct_class_instance method has been made private.'
106 . " The public version is deprecated and will be removed in a future release.\n"
108 shift->_construct_class_instance(@_);
111 sub check_metaclass_compatibility {
112 Class::MOP::Deprecated::deprecated(
113 'The check_metaclass_compatibility method has been made private.'
114 . " The public version is deprecated and will be removed in a future release.\n"
116 shift->_check_metaclass_compatibility(@_);
119 sub construct_instance {
120 Class::MOP::Deprecated::deprecated(
121 'The construct_instance method has been made private.'
122 . " The public version is deprecated and will be removed in a future release.\n"
124 shift->_construct_instance(@_);
127 sub create_meta_instance {
128 Class::MOP::Deprecated::deprecated(
129 'The create_meta_instance method has been made private.'
130 . " The public version is deprecated and will be removed in a future release.\n"
132 shift->_create_meta_instance(@_);
136 Class::MOP::Deprecated::deprecated(
137 'The clone_instance method has been made private.'
138 . " The public version is deprecated and will be removed in a future release.\n"
140 shift->_clone_instance(@_);
144 Class::MOP::Deprecated::deprecated(
145 "The alias_method method is deprecated. Use add_method instead.\n");
147 shift->add_method(@_);
150 sub compute_all_applicable_methods {
151 Class::MOP::Deprecated::deprecated(
152 'The compute_all_applicable_methods method is deprecated.'
153 . " Use get_all_methods instead.\n" );
158 class => $_->package_name,
159 code => $_, # sigh, overloading
161 } shift->get_all_methods(@_);
164 sub compute_all_applicable_attributes {
165 Class::MOP::Deprecated::deprecated(
166 'The compute_all_applicable_attributes method has been deprecated.'
167 . " Use get_all_attributes instead.\n" );
169 shift->get_all_attributes(@_);
172 sub get_attribute_map {
173 Class::MOP::Deprecated::deprecated(
174 "The get_attribute_map method has been deprecated.\n");
176 shift->_attribute_map(@_);
180 Class::MOP::Instance;
182 sub bless_instance_structure {
183 Class::MOP::Deprecated::deprecated(
184 'The bless_instance_structure method is deprecated.'
185 . " It will be removed in a future release.\n" );
187 my ( $self, $instance_structure ) = @_;
188 bless $instance_structure, $self->_class_name;
192 Class::MOP::Attribute;
194 sub process_accessors {
195 Class::MOP::Deprecated::deprecated(
196 'The process_accessors method has been made private.'
197 . " The public version is deprecated and will be removed in a future release.\n"
199 shift->_process_accessors(@_);
203 Class::MOP::Method::Accessor;
205 sub initialize_body {
206 Class::MOP::Deprecated::deprecated(
207 'The initialize_body method has been made private.'
208 . " The public version is deprecated and will be removed in a future release.\n"
210 shift->_initialize_body;
213 sub generate_accessor_method {
214 Class::MOP::Deprecated::deprecated(
215 'The generate_accessor_method method has been made private.'
216 . " The public version is deprecated and will be removed in a future release.\n"
218 shift->_generate_accessor_method;
221 sub generate_reader_method {
222 Class::MOP::Deprecated::deprecated(
223 'The generate_reader_method method has been made private.'
224 . " The public version is deprecated and will be removed in a future release.\n"
226 shift->_generate_reader_method;
229 sub generate_writer_method {
230 Class::MOP::Deprecated::deprecated(
231 'The generate_writer_method method has been made private.'
232 . " The public version is deprecated and will be removed in a future release.\n"
234 shift->_generate_writer_method;
237 sub generate_predicate_method {
238 Class::MOP::Deprecated::deprecated(
239 'The generate_predicate_method method has been made private.'
240 . " The public version is deprecated and will be removed in a future release.\n"
242 shift->_generate_predicate_method;
245 sub generate_clearer_method {
246 Class::MOP::Deprecated::deprecated(
247 'The generate_clearer_method method has been made private.'
248 . " The public version is deprecated and will be removed in a future release.\n"
250 shift->_generate_clearer_method;
253 sub generate_accessor_method_inline {
254 Class::MOP::Deprecated::deprecated(
255 'The generate_accessor_method_inline method has been made private.'
256 . " The public version is deprecated and will be removed in a future release.\n"
258 shift->_generate_accessor_method_inline;
261 sub generate_reader_method_inline {
262 Class::MOP::Deprecated::deprecated(
263 'The generate_reader_method_inline method has been made private.'
264 . " The public version is deprecated and will be removed in a future release.\n"
266 shift->_generate_reader_method_inline;
269 sub generate_writer_method_inline {
270 Class::MOP::Deprecated::deprecated(
271 'The generate_writer_method_inline method has been made private.'
272 . " The public version is deprecated and will be removed in a future release.\n"
274 shift->_generate_writer_method_inline;
277 sub generate_predicate_method_inline {
278 Class::MOP::Deprecated::deprecated(
279 'The generate_predicate_method_inline method has been made private.'
280 . " The public version is deprecated and will be removed in a future release.\n"
282 shift->_generate_predicate_method_inline;
285 sub generate_clearer_method_inline {
286 Class::MOP::Deprecated::deprecated(
287 'The generate_clearer_method_inline method has been made private.'
288 . " The public version is deprecated and will be removed in a future release.\n"
290 shift->_generate_clearer_method_inline;
294 Class::MOP::Method::Constructor;
297 Class::MOP::Deprecated::deprecated(
298 'The meta_instance method has been made private.'
299 . " The public version is deprecated and will be removed in a future release.\n"
301 shift->_meta_instance;
305 Class::MOP::Deprecated::deprecated(
306 'The attributes method has been made private.'
307 . " The public version is deprecated and will be removed in a future release.\n"
310 return shift->_attributes;
313 sub initialize_body {
314 Class::MOP::Deprecated::deprecated(
315 'The initialize_body method has been made private.'
316 . " The public version is deprecated and will be removed in a future release.\n"
318 shift->_initialize_body;
321 sub generate_constructor_method {
322 Class::MOP::Deprecated::deprecated(
323 'The generate_constructor_method method has been made private.'
324 . " The public version is deprecated and will be removed in a future release.\n"
326 shift->_generate_constructor_method;
329 sub generate_constructor_method_inline {
330 Class::MOP::Deprecated::deprecated(
331 'The generate_constructor_method_inline method has been made private.'
332 . " The public version is deprecated and will be removed in a future release.\n"
334 shift->_generate_constructor_method_inline;
345 Class::MOP::Deprecated - Manages deprecation warnings for Class::MOP
349 use Class::MOP::Deprecated -api_version => $version;
353 This module manages deprecation warnings for features that have been
354 deprecated in Class::MOP.
356 If you specify C<< -api_version => $version >>, you can use deprecated features
357 without warnings. Note that this special treatment is limited to the package
358 that loads C<Class::MOP::Deprecated>.
362 Goro Fuji E<lt>gfuji@cpan.orgE<gt>
364 =head1 COPYRIGHT AND LICENSE
366 Copyright 2006-2010 by Infinity Interactive, Inc.
368 L<http://www.iinteractive.com>
370 This library is free software; you can redistribute it and/or modify
371 it under the same terms as Perl itself.