annotate Lib/IMPL/DOM/Schema/SimpleNode.pm @ 103:c289ed9662ca

Schema beta 2 More strict validation, support for inflating a simple nodes and properties
author wizard
date Fri, 07 May 2010 18:17:40 +0400
parents 16ada169ca75
children 196bf443b5e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
1 package IMPL::DOM::Schema::SimpleNode;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
4
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
5 use base qw(IMPL::DOM::Schema::Node);
103
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
6 use IMPL::Class::Property;
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
7 use IMPL::Class::Property::Direct;
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
8
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
9 BEGIN {
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
10 public _direct property inflator => prop_get;
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
11 }
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
12
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
13 our %CTOR = (
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
14 'IMPL::DOM::Schema::Node' => sub {my %args = @_; $args{nodeName} ||= 'SimpleNode'; %args}
103
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
15 );
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
16
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
17 sub CTOR {
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
18 my ($this,%args) = @_;
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
19
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
20 $this->{$inflator} = $args{inflator} if $args{iflator};
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
21 }
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
22
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
23 sub Validate {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
24 my ($this,$node) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
25
103
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
26 return map $_->Validate($node), @{$this->childNodes};
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
27 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
28
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
29 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
30
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
31 __END__
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
32
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
33 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
34
103
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
35 =head1 NAME
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
36
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
37 C<IMPL::DOM::SimpleNode> - узел с текстом.
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
38
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
39 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
40
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
41 Узел имеющий простое значение. Данный узел может содержать ограничения
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
42 на простое значение.
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
43
103
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
44 Производит валидацию содержимого, при постоении DOM модели не имеет специального
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
45 типа и будет создан в виде C<IMPL::DOM::Node>.
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
46
c289ed9662ca Schema beta 2
wizard
parents: 49
diff changeset
47 Также определяет как будет воссоздано значение узла в DOM модели.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
48
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 20
diff changeset
49 =cut