Mercurial > pub > Impl
diff Lib/IMPL/DOM/Schema/Validator/RegExp.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 | 2904da230022 |
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Schema/Validator/RegExp.pm Tue Apr 10 08:13:22 2012 +0400 +++ b/Lib/IMPL/DOM/Schema/Validator/RegExp.pm Tue Apr 10 20:08:29 2012 +0400 @@ -3,42 +3,42 @@ use parent qw(IMPL::DOM::Schema::Validator); our %CTOR = ( - 'IMPL::DOM::Schema::Validator' => sub { - my %args = @_; - $args{nodeName} ||= 'RegExp'; - %args; - } + 'IMPL::DOM::Schema::Validator' => sub { + my %args = @_; + $args{nodeName} ||= 'RegExp'; + %args; + } ); use IMPL::Class::Property; BEGIN { - public property message => prop_all; - public property launder => prop_all; - private property _rx => prop_all; + public property message => prop_all; + public property launder => prop_all; + private property _rx => prop_all; } sub CTOR { - my ($this,%args) = @_; - - $this->message($args{message} || "A %Node.nodeName% doesn't match to the format %Schema.display%"); + my ($this,%args) = @_; + + $this->message($args{message} || "A %Node.nodeName% doesn't match to the format %Schema.display%"); } sub Validate { - my ($this,$node,$ctx) = @_; - - my $rx = $this->_rx() || $this->_rx( map qr{$_}, $this->nodeValue ); - - return new IMPL::DOM::Schema::ValidationError( - Node => $node, - Source => $ctx && $ctx->{Source} || $this->parentNode, - Schema => $this->parentNode, - Message => $this->message - ) unless (not $node->isComplex) and $node->nodeValue =~ /($rx)/; - - $node->nodeValue($1) if $this->launder; - - return (); + my ($this,$node,$ctx) = @_; + + my $rx = $this->_rx() || $this->_rx( map qr{$_}, $this->nodeValue ); + + return new IMPL::DOM::Schema::ValidationError( + Node => $node, + Source => $ctx && $ctx->{Source} || $this->parentNode, + Schema => $this->parentNode, + Message => $this->message + ) unless (not $node->isComplex) and $node->nodeValue =~ /($rx)/; + + $node->nodeValue($1) if $this->launder; + + return (); } 1;