Mercurial > pub > Impl
view Lib/IMPL/DOM/Schema/SimpleNode.pm @ 171:59e5fcb59d86
Исправления, изменена концепция веб-форм
author | sourcer |
---|---|
date | Mon, 06 Jun 2011 03:30:36 +0400 |
parents | 76515373dac0 |
children | d1676be8afcc |
line wrap: on
line source
package IMPL::DOM::Schema::SimpleNode; use strict; use warnings; use parent qw(IMPL::DOM::Schema::Node); use IMPL::Class::Property; use IMPL::Class::Property::Direct; use IMPL::DOM::Property qw(_dom); BEGIN { public _dom _direct property inflator => prop_get; public _dom _direct property messageInflateError => prop_get; } our %CTOR = ( 'IMPL::DOM::Schema::Node' => sub { my %args = @_; $args{nodeName} ||= 'SimpleNode'; delete @args{qw(inflator messageInflateError)}; %args } ); sub CTOR { my ($this,%args) = @_; if ( $args{inflator} ) { $this->{$inflator} = $args{inflator} ; $this->{$messageInflateError} = exists $args{messageInflateError} ? $args{messageInflateError} : 'Failed to inflate nodeValue %Node.path%: %Error%'; } } sub Validate { my ($this,$node,$ctx) = @_; my @result; push @result, $_->Validate($node,$ctx) foreach $this->childNodes; return @result; } sub inflateValue { my ($this,$value) = @_; if ( my $inflator = $this->inflator ) { return $inflator->new($value); } else { return $value; } } 1; __END__ =pod =head1 NAME C<IMPL::DOM::SimpleNode> - . =head1 DESCRIPTION . . , DOM C<IMPL::DOM::Node>. DOM . =cut