diff Lib/IMPL/Object/Autofill.pm @ 278:4ddb27ff4a0b

core refactoring
author cin
date Mon, 04 Feb 2013 02:10:37 +0400
parents 6253872024a4
children
line wrap: on
line diff
--- a/Lib/IMPL/Object/Autofill.pm	Fri Feb 01 16:37:59 2013 +0400
+++ b/Lib/IMPL/Object/Autofill.pm	Mon Feb 04 02:10:37 2013 +0400
@@ -1,6 +1,7 @@
 package IMPL::Object::Autofill;
 use strict;
-use IMPL::Class::Property;
+
+use IMPL::Const qw(:access);
 
 sub CTOR {
     my $this = shift;
@@ -51,18 +52,17 @@
 HEADER
         
         
-        if ($class->can('get_meta')) {
+        if ($class->can('GetMeta')) {
             # meta supported
             foreach my $prop_info (grep {
-                my $mutators = $_->mutators;
-                ref $mutators ? (exists $mutators->{set}) : ($mutators & prop_set || $_->implementor->isa('IMPL::Class::Property::Direct'));
-            } $class->get_meta('IMPL::Class::PropertyInfo')) {
+                $_->setter && ($_->access & ACCESS_PUBLIC);
+            } $class->GetMeta('IMPL::Class::PropertyInfo')) {
                 my $name = $prop_info->name;
-                if (ref $prop_info->mutators || !$prop_info->implementor->isa('IMPL::Class::Property::Direct')) {
+                if ($prop_info->isa('IMPL::Class::DirectPropertyInfo')) {
                     $text .= "    \$this->$name(\$fields->{$name}) if exists \$fields->{$name};\n";
                 } else {
-                    my $fld = $prop_info->implementor->FieldName($prop_info);
-                    if ($prop_info->mutators & prop_list) {
+                    my $fld = $prop_info->fieldName;
+                    if ($prop_info->isList) {
                         $text .= "    \$this->{$fld} = IMPL::Object::List->new ( ref \$fields->{$name} ? \$fields->{$name} : [\$fields->{$name}] ) if exists \$fields->{$name};\n";
                     } else {
                         $text .= "    \$this->{$fld} = \$fields->{$name} if exists \$fields->{$name};\n";