0
|
1 package IMPL::DOM::Node;
|
|
2 use strict;
|
|
3 use warnings;
|
|
4
|
|
5 use base qw(IMPL::Object IMPL::Object::Serializable IMPL::Object::Autofill);
|
|
6
|
|
7 use IMPL::Class::Property;
|
|
8 use IMPL::Class::Property::Direct;
|
|
9 use Scalar::Util qw(weaken);
|
|
10
|
1
|
11 use IMPL::Exception;
|
|
12
|
0
|
13 __PACKAGE__->PassThroughArgs;
|
|
14
|
|
15 BEGIN {
|
|
16 public property nodeName => prop_get | owner_set;
|
|
17 public property isComplex => prop_get | owner_set;
|
|
18 public property nodeValue => prop_get | owner_set;
|
|
19 public property childNodes => prop_get | owner_set| prop_list;
|
|
20 public property parentNode => prop_get | owner_set;
|
|
21 private property _propertyMap => prop_all;
|
|
22 }
|
|
23
|
|
24 sub CTOR {
|
1
|
25 my ($this,$name) = @_;
|
0
|
26
|
1
|
27 $this->nodeName($name) or die new IMPL::InvalidArgumentException("A name is required");
|
0
|
28 $this->_propertyMap({});
|
|
29 }
|
|
30
|
|
31 sub insertNode {
|
|
32 my ($this,$node,$pos) = @_;
|
|
33 }
|
|
34
|
|
35 sub removeNode {
|
|
36 my ($this,$node) = @_;
|
|
37 }
|
|
38
|
|
39 sub removeAt {
|
|
40 my ($this,$pos) = @_;
|
|
41 }
|
|
42
|
|
43 sub selectNodes {
|
|
44 my ($this,$name) = @_;
|
|
45 }
|
|
46
|
|
47 sub setParent {
|
|
48 my ($this,$parentNode) = @_;
|
|
49 }
|
|
50
|
|
51 sub text {
|
|
52 my ($this) = @_;
|
|
53 }
|
|
54
|
|
55 sub Property {
|
|
56 my $this = shift;
|
|
57 my $name = shift;
|
|
58
|
|
59 if (@_) {
|
|
60 # set
|
|
61 return $this->_propertyMap->{$name} = shift;
|
|
62 } else {
|
|
63 return $this->_propertyMap->{$name};
|
|
64 }
|
|
65 }
|
|
66
|
|
67 1;
|