diff Lib/IMPL/Class/Property/Base.pm @ 230:6d8092d8ce1b

*reworked IMPL::Security *reworked IMPL::Web::Security *refactoring
author sergey
date Mon, 08 Oct 2012 03:37:37 +0400
parents 4d0e1962161c
children 6253872024a4
line wrap: on
line diff
--- a/Lib/IMPL/Class/Property/Base.pm	Sat Sep 29 02:34:47 2012 +0400
+++ b/Lib/IMPL/Class/Property/Base.pm	Mon Oct 08 03:37:37 2012 +0400
@@ -1,9 +1,7 @@
 package IMPL::Class::Property::Base;
 use strict;
 
-use IMPL::Class::Property;
-
-require IMPL::Class::Member;
+use IMPL::Const qw(:all);
 
 sub factoryParams { qw($class $name $set $get $validator) };
 
@@ -18,9 +16,9 @@
 my $validator_code = '$this->$validator(@_);'; 
 
 my %access_code = (
-    IMPL::Class::Member::MOD_PUBLIC , "",
-    IMPL::Class::Member::MOD_PROTECTED, "die new IMPL::Exception('Can\\'t access the protected member',\$name,\$class,scalar caller) unless UNIVERSAL::isa(scalar caller,\$class);",
-    IMPL::Class::Member::MOD_PRIVATE, "die new IMPL::Exception('Can\\'t access the private member',\$name,\$class,scalar caller) unless caller eq \$class;" 
+    ACCESS_PUBLIC , "",
+    ACCESS_PROTECTED, "die new IMPL::Exception('Can\\'t access the protected member',\$name,\$class,scalar caller) unless UNIVERSAL::isa(scalar caller,\$class);",
+    ACCESS_PRIVATE, "die new IMPL::Exception('Can\\'t access the private member',\$name,\$class,scalar caller) unless caller eq \$class;" 
 );
 
 my $virtual_call = q(
@@ -36,14 +34,14 @@
     my %accessors;
     
     if (not ref $param) {
-        if ($param & prop_list) {
-            $accessors{get} = ($param & prop_get) ? $self->GenerateGetList(@params) : undef;
-            $accessors{set} = ($param & prop_set) ? $self->GenerateSetList(@params) : undef;
+        if ($param & PROP_LIST) {
+            $accessors{get} = ($param & PROP_GET) ? $self->GenerateGetList(@params) : undef;
+            $accessors{set} = ($param & PROP_SET) ? $self->GenerateSetList(@params) : undef;
         } else {
-            $accessors{get} = ($param & prop_get) ? $self->GenerateGet(@params) : undef;
-            $accessors{set} = ($param & prop_set) ? $self->GenerateSet(@params) : undef;
+            $accessors{get} = ($param & PROP_GET) ? $self->GenerateGet(@params) : undef;
+            $accessors{set} = ($param & PROP_SET) ? $self->GenerateSet(@params) : undef;
         }
-        $accessors{owner} = (($param & owner_set) == owner_set) ? $owner_check : "";
+        $accessors{owner} = (($param & PROP_OWNERSET) == PROP_OWNERSET) ? $owner_check : "";
     } elsif (UNIVERSAL::isa($param,'HASH')) {
         $accessors{get} = $param->{get} ? $custom_accessor_get : undef;
         $accessors{set} = $param->{set} ? $custom_accessor_set : undef;
@@ -108,6 +106,10 @@
     1;
 }
 
+sub Implement {
+    my ($self,$spec) = @_;
+}
+
 # extract from property info: class, name, get_accessor, set_accessor, validator
 sub RemapFactoryParams {
     my ($self,$propInfo) = @_;