diff Lib/IMPL/Serialization.pm @ 115:5edc2ac5231c

minor fix to the serialization mechanism
author wizard
date Wed, 26 May 2010 02:32:22 +0400
parents b0c068da93ac
children fb896377389f
line wrap: on
line diff
--- a/Lib/IMPL/Serialization.pm	Tue May 25 01:26:42 2010 +0400
+++ b/Lib/IMPL/Serialization.pm	Wed May 26 02:32:22 2010 +0400
@@ -178,13 +178,15 @@
   # ������� �������������������� �������.
   # SurogateHelper($Type)
   # $Type ��� �����, ��� ������� ����� �������.
-  private _direct property SurogateHelper => prop_all;
+  private _direct property SurrogateHelper => prop_all;
 }
 
 sub CTOR {
   my ($this,%args) = @_;
   $this->{$CurrentObject} = undef;
   $this->{$Root} = undef;
+  $this->{$ObjectFactory} = $args{ObjectFactory} if $args{ObjectFactory};
+  $this->{$SurrogateHelper} = $args{SurrogateHelper} if $args{SurrogateHelper};
 }
 
 sub OnObjectBegin {
@@ -223,7 +225,7 @@
 
 	if (defined $rhProps->{'id'}) {                          
     	die new IMPL::Exception("Trying to create a simple object instead of a reference, type is missing.",$name,$rhProps->{id}) unless $rhProps->{'type'} ;
-    	$this->{$Context}->{$rhProps->{'id'}} = $this->{$SurogateHelper} ? $this->{$SurogateHelper}->($rhProps->{'type'}) : DefaultSurogateHelper($rhProps->{'type'});
+    	$this->{$Context}->{$rhProps->{'id'}} = $this->{$SurrogateHelper} ? $this->{$SurrogateHelper}->($rhProps->{'type'}) : DefaultSurrogateHelper($rhProps->{'type'});
 	}
   }
   
@@ -300,7 +302,7 @@
   scalar keys %{"$_[0]::"} ? 1 : 0;
 }
 
-sub DefaultSurogateHelper {
+sub DefaultSurrogateHelper {
   my ($Type) = @_;
   
   if ($Type eq 'SCALAR' or $Type eq 'REF') {