Mercurial > pub > Impl
diff Lib/IMPL/DOM/Navigator/Builder.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author | cin |
---|---|
date | Tue, 10 Apr 2012 20:08:29 +0400 |
parents | d1676be8afcc |
children | c8fe3f84feba |
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Navigator/Builder.pm Tue Apr 10 08:13:22 2012 +0400 +++ b/Lib/IMPL/DOM/Navigator/Builder.pm Tue Apr 10 20:08:29 2012 +0400 @@ -51,17 +51,17 @@ } if (@errors) { - $this->BuildErrors->Append( - map { - IMPL::DOM::Schema::ValidationError->new( - Node => $node, - Source => $schemaSource, - Schema => $schemaNode, - Message => $schemaNode->messageInflateError, - Error => $_ - ) - } @errors - ); + $this->BuildErrors->Append( + map { + IMPL::DOM::Schema::ValidationError->new( + Node => $node, + Source => $schemaSource, + Schema => $schemaNode, + Message => $schemaNode->messageInflateError, + Error => $_ + ) + } @errors + ); } return $node; @@ -71,40 +71,40 @@ } sub inflateProperties { - my ($this,$schemaNode,$refProps) = @_; - my @errors; - foreach my $schemaProp ( $schemaNode->selectNodes('Property') ) { - next if not exists $refProps->{$schemaProp->name}; - my $result = eval {$schemaProp->inflateValue($refProps->{$schemaProp->name}) }; - if (my $e = $@) { - push @errors, $e; - } else { - $refProps->{$schemaProp->name} = $result; - } - } - return @errors; + my ($this,$schemaNode,$refProps) = @_; + my @errors; + foreach my $schemaProp ( $schemaNode->selectNodes('Property') ) { + next if not exists $refProps->{$schemaProp->name}; + my $result = eval {$schemaProp->inflateValue($refProps->{$schemaProp->name}) }; + if (my $e = $@) { + push @errors, $e; + } else { + $refProps->{$schemaProp->name} = $result; + } + } + return @errors; } sub inflateValue { - my ($this,$value,$node) = @_; - - $node ||= $this->Current; - - my $nodeSchema = $this->{$_schemaNavi}->Current; - - my $result = eval { $nodeSchema->inflateValue($value) }; - if (my $e=$@) { - $this->BuildErrors->Append(new IMPL::DOM::Schema::ValidationError( - Schema => $nodeSchema, - Node => $node, - Error => $e, - Message => $nodeSchema->messageInflateError, - Source => $this->{$_schemaNavi}->SourceSchemaNode - )); - return $value; - } else { - return $result; - } + my ($this,$value,$node) = @_; + + $node ||= $this->Current; + + my $nodeSchema = $this->{$_schemaNavi}->Current; + + my $result = eval { $nodeSchema->inflateValue($value) }; + if (my $e=$@) { + $this->BuildErrors->Append(new IMPL::DOM::Schema::ValidationError( + Schema => $nodeSchema, + Node => $node, + Error => $e, + Message => $nodeSchema->messageInflateError, + Source => $this->{$_schemaNavi}->SourceSchemaNode + )); + return $value; + } else { + return $result; + } } sub Back { @@ -115,17 +115,17 @@ } sub saveState { - my ($this) = @_; - - $this->{$_schemaNavi}->saveState; - $this->SUPER::saveState; + my ($this) = @_; + + $this->{$_schemaNavi}->saveState; + $this->SUPER::saveState; } sub restoreState { - my ($this) = @_; - - $this->{$_schemaNavi}->restoreState; - $this->SUPER::restoreState; + my ($this) = @_; + + $this->{$_schemaNavi}->restoreState; + $this->SUPER::restoreState; } 1;