annotate Lib/IMPL/DOM/Node.pm @ 3:2e546a5175dd

in developing
author Sergey
date Tue, 11 Aug 2009 17:45:52 +0400
parents 3b418b134d8c
children e59f44f75f20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 package IMPL::DOM::Node;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use warnings;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5 use base qw(IMPL::Object IMPL::Object::Serializable IMPL::Object::Autofill);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7 use IMPL::Class::Property;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8 use IMPL::Class::Property::Direct;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9 use Scalar::Util qw(weaken);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10
1
3b418b134d8c ORM in progress
Sergey
parents: 0
diff changeset
11 use IMPL::Exception;
3b418b134d8c ORM in progress
Sergey
parents: 0
diff changeset
12
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 __PACKAGE__->PassThroughArgs;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
15 BEGIN {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
16 public property nodeName => prop_get | owner_set;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
17 public property isComplex => prop_get | owner_set;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
18 public property nodeValue => prop_get | owner_set;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
19 public property childNodes => prop_get | owner_set| prop_list;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
20 public property parentNode => prop_get | owner_set;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
21 private property _propertyMap => prop_all;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
22 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
23
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
24 sub CTOR {
1
3b418b134d8c ORM in progress
Sergey
parents: 0
diff changeset
25 my ($this,$name) = @_;
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
26
1
3b418b134d8c ORM in progress
Sergey
parents: 0
diff changeset
27 $this->nodeName($name) or die new IMPL::InvalidArgumentException("A name is required");
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
28 $this->_propertyMap({});
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
29 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
30
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
31 sub insertNode {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
32 my ($this,$node,$pos) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
33 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
34
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
35 sub removeNode {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
36 my ($this,$node) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
37 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
38
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
39 sub removeAt {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
40 my ($this,$pos) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
41 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
42
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
43 sub selectNodes {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
44 my ($this,$name) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
45 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
46
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
47 sub setParent {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
48 my ($this,$parentNode) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
49 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
50
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
51 sub text {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
52 my ($this) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
53 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
54
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
55 sub Property {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
56 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
57 my $name = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
58
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
59 if (@_) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
60 # set
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
61 return $this->_propertyMap->{$name} = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
62 } else {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
63 return $this->_propertyMap->{$name};
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
64 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
65 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
66
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
67 1;