comparison lib/IMPL/DOM/Navigator/SimpleBuilder.pm @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents
children
comparison
equal deleted inserted replaced
406:f23fcb19d3c1 407:c6e90e02dd17
1 package IMPL::DOM::Navigator::SimpleBuilder;
2 use strict;
3 use warnings;
4
5 use parent qw(IMPL::DOM::Navigator);
6
7 use IMPL::Class::Property;
8
9 require IMPL::DOM::Navigator::SchemaNavigator;
10 use IMPL::DOM::Document;
11
12 BEGIN {
13 public _direct property Document => prop_get | owner_set;
14 }
15
16 our %CTOR = (
17 'IMPL::DOM::Navigator' => sub { IMPL::DOM::Document::Empty; }
18 );
19
20 sub NavigateCreate {
21 my ($this,$nodeName,%props) = @_;
22
23 my $node;
24 if (! $this->{$Document}) {
25 $node = $this->{$Document} = IMPL::DOM::Document->new(nodeName => $nodeName,%props);
26 $this->_initNavigator($node);
27 } else {
28 die new IMPL::InvalidOperationException('Can create a second top level element') unless $this->Current;
29 $node = $this->{$Document}->Create($nodeName,'IMPL::DOM::Node',\%props);
30 $this->Current->appendChild($node);
31 $this->internalNavigateNodeSet($node);
32 }
33 return $node;
34 }
35
36 sub inflateValue {
37 $_[1];
38 }
39
40 1;