annotate Lib/IMPL/DOM/Navigator/Builder.pm @ 28:6d33f75c6e1f

ORM in works
author Sergey
date Mon, 19 Oct 2009 04:13:54 +0400
parents 7f00786f8210
children a8086f85a571
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
1 package IMPL::DOM::Navigator::Builder;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
2 use strict;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
3 use warnings;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
4
75980091813b DOM и навигация
Sergey
parents:
diff changeset
5 use base qw(IMPL::DOM::Navigator);
75980091813b DOM и навигация
Sergey
parents:
diff changeset
6 use IMPL::Class::Property;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
7 use IMPL::Class::Property::Direct;
24
7f00786f8210 Первая рабочая реазизация схемы и навигаторов
Sergey
parents: 16
diff changeset
8 require IMPL::DOM::Navigator::SchemaNavigator;
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
9
75980091813b DOM и навигация
Sergey
parents:
diff changeset
10 BEGIN {
24
7f00786f8210 Первая рабочая реазизация схемы и навигаторов
Sergey
parents: 16
diff changeset
11 protected _direct property _schemaNavi => prop_all;
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
12 public _direct property Document => prop_get | owner_set;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
13 }
75980091813b DOM и навигация
Sergey
parents:
diff changeset
14
15
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
15 our %CTOR = (
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
16 'IMPL::DOM::Navigator' => sub { $_[0] } # IMPL::DOM::Navigator($domDocument)
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
17 );
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
18
75980091813b DOM и навигация
Sergey
parents:
diff changeset
19 sub CTOR {
75980091813b DOM и навигация
Sergey
parents:
diff changeset
20 my ($this,$domDocument,$schema) = @_;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
21
75980091813b DOM и навигация
Sergey
parents:
diff changeset
22 $this->{$Document} = $domDocument;
24
7f00786f8210 Первая рабочая реазизация схемы и навигаторов
Sergey
parents: 16
diff changeset
23 $this->{$_schemaNavi} = $schema;
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
24 }
75980091813b DOM и навигация
Sergey
parents:
diff changeset
25
75980091813b DOM и навигация
Sergey
parents:
diff changeset
26 sub NavigateCreate {
75980091813b DOM и навигация
Sergey
parents:
diff changeset
27 my ($this,$nodeName,%props) = @_;
75980091813b DOM и навигация
Sergey
parents:
diff changeset
28
24
7f00786f8210 Первая рабочая реазизация схемы и навигаторов
Sergey
parents: 16
diff changeset
29
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
30 }
75980091813b DOM и навигация
Sergey
parents:
diff changeset
31
15
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
32 sub Back {
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
33 my ($this) = @_;
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
34
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
35 }
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
36
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
37 1;
15
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
38
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
39 __END__
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
40 =pod
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
41
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
42 =head1 SYNOPSIS
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
43
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
44 my $builder = new IMPL::DOM::Navigator::Builder(new MyApp::Document,$schema);
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
45 my $reader = new IMPL::DOM::XMLReader(Navigator => $builder);
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
46
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
47 $reader->ParseFile("document.xml");
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
48
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
49 my @errors = $schema->Validate($builder->Document);
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
50
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
51 =head1 DESCRIPTION
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
52
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
53 DOM .
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
54 C<IMPL::DOM::XMLReader>.
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
55
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
56 =head1 METHODS
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
57
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
58 =over
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
59
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
60 =item C<CTOR($domDocument,$schema)>
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
61
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
62 , ( )
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
63 .
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
64
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
65 =item C<< $obj->NavigateCreate($nodeName) >>
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
66
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
67 .
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
68 , .
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
69
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
70 ,
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
71 ,
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
72
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
73 =over
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
74
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
75 =item C<type> ,
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
76
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
77 =item C<type> , ,
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
78 .
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
79
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
80 =item
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
81
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
82 =back
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
83
16
75d55f4ee263 Окончательная концепция описания схем и построения DOM документов
Sergey
parents: 15
diff changeset
84 C<nodeName>.
15
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
85
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
86 .. C<< <ComplexNode nodeName="Box" type="Container"> >>
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
87 C<< Container->new(nodeName => 'Box') >>.
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
88
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
89 =back
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
90
16795016e70b Dom schema in progress
Sergey
parents: 14
diff changeset
91 =cut