diff Lib/IMPL/Code/BasePropertyImplementor.pm @ 278:4ddb27ff4a0b

core refactoring
author cin
date Mon, 04 Feb 2013 02:10:37 +0400
parents 6585464c4664
children ced5937ff21a
line wrap: on
line diff
--- a/Lib/IMPL/Code/BasePropertyImplementor.pm	Fri Feb 01 16:37:59 2013 +0400
+++ b/Lib/IMPL/Code/BasePropertyImplementor.pm	Mon Feb 04 02:10:37 2013 +0400
@@ -45,7 +45,8 @@
             get => $spec & PROP_GET,
             set => $spec & PROP_SET,
             isList => $spec & PROP_LIST,
-            ownerSet => $spec & PROP_OWNERSET
+            ownerSet => (($spec & PROP_OWNERSET) == PROP_OWNERSET),
+            direct => $spec & PROP_DIRECT
         };	    
 }
 
@@ -54,14 +55,14 @@
 	
 	join( '',
         map(
-            $_
-                ? ref $_ eq 'CODE'
+            ($_
+                ? (ref $_ eq 'CODE'
                     ? 'x'
-                    : 's'
-                : '_',
+                    : 's')
+                : '_'),
             @$spec{qw(get set)}
         ),
-        $spec->{access},
+        $spec->{access} || ACCESS_PUBLIC,
         $spec->{validator} ? 'v' : '_',
         $spec->{isList} ? 'l' : '_',
         $spec->{ownerSet} ? 'o' : '_'
@@ -72,20 +73,26 @@
 	my ($self,$spec) = @_;
 	
 	return $self->CreateFactoryImpl(
-        $spec->{get}
-            ? ref $spec->{get} eq 'CODE'
+        ($spec->{get}
+            ? (ref $spec->{get} eq 'CODE'
                 ? $self->CodeCustomGetAccessor
-                : $spec->{isList}
-                    ? $spec->CodeGetListAccessor
-                    : $spec->CodeGetAccessor
-            : $spec->CodeNoGetAccessor,
-        $spec->{set}
-            ? ref $spec->{set} eq 'CODE'
+                : ($spec->{isList}
+                    ? $self->CodeGetListAccessor
+                    : $self->CodeGetAccessor
+                  )
+              )
+            : $self->CodeNoGetAccessor
+        ),
+        ($spec->{set}
+            ? (ref $spec->{set} eq 'CODE'
                 ? $self->CodeCustomSetAccessor
-                : $spec->{isList}
-                    ? $spec->CodeSetListAccessor
-                    : $spec->CodeSetAccessor
-            : $spec->CodeNoSetAccessor,
+                : ($spec->{isList}
+                    ? $self->CodeSetListAccessor
+                    : $self->CodeSetAccessor
+                  )
+              )
+            : $self->CodeNoSetAccessor
+        ),
         $ACCESS_CODE{$spec->{access} || ACCESS_PUBLIC} || '',
         $spec->{validator} ? $self->CodeValidator : '',
         $spec->{ownerSet} ? $self->CodeOwnerCheck : ''