comparison Lib/IMPL/DOM/Node.pm @ 315:77df11605d3a

code cleanup
author cin
date Tue, 07 May 2013 02:19:24 +0400
parents c6d0f889ef87
children 4edd36025051
comparison
equal deleted inserted replaced
314:109f28643025 315:77df11605d3a
1 package IMPL::DOM::Node; 1 package IMPL::DOM::Node;
2 use strict; 2 use strict;
3 use warnings; 3 use warnings;
4 4
5 use parent qw(IMPL::Object); 5 use Scalar::Util qw(weaken);
6 6
7 use IMPL::lang; 7 use IMPL::lang;
8 use IMPL::Object::List; 8 use IMPL::Object::List;
9 use IMPL::Class::Property; 9
10 use Scalar::Util qw(weaken); 10 use IMPL::Exception();
11 11 use IMPL::Const qw(:prop);
12 use IMPL::Exception; 12 use IMPL::declare {
13 13 require => {
14 BEGIN { 14 PropertyInfo => '-IMPL::Class::PropertyInfo'
15 public _direct property nodeName => prop_get; 15 },
16 public _direct property document => prop_get; 16 base => [
17 public _direct property isComplex => { get => \&_getIsComplex } ; 17 'IMPL::Object' => undef
18 public _direct property nodeValue => prop_all; 18 ],
19 public _direct property childNodes => { get => \&_getChildNodes }; # prop_list 19 props => [
20 public _direct property parentNode => prop_get | owner_set; 20 nodeName => PROP_RO | PROP_DIRECT,
21 public _direct property schema => prop_get | owner_set; 21 document => PROP_RO | PROP_DIRECT,
22 public _direct property schemaSource => prop_get | owner_set; 22 isComplex => { get => \&_getIsComplex },
23 private _direct property _propertyMap => prop_all ; 23 nodeValue => PROP_RW | PROP_DIRECT,
24 24 childNodes => { get => \&_getChildNodes, isList => 1, direct => 1 },
25 } 25 parentNode => PROP_RO | PROP_DIRECT,
26 schema => PROP_RO | PROP_DIRECT,
27 schemaSource => PROP_RO | PROP_DIRECT,
28 _propertyMap => PROP_RW | PROP_DIRECT
29 ]
30 };
26 31
27 our %Axes = ( 32 our %Axes = (
28 parent => \&selectParent, 33 parent => \&selectParent,
29 siblings => \&selectSiblings, 34 siblings => \&selectSiblings,
30 child => \&childNodes, 35 child => \&childNodes,
386 } 391 }
387 392
388 sub listProperties { 393 sub listProperties {
389 my ($this) = @_; 394 my ($this) = @_;
390 395
391 my %props = map {$_->name, 1} $this->GetMeta(typeof IMPL::Class::PropertyInfo, sub { $_->attributes->{domProperty}},1); 396 my %props = map {$_->name, 1} $this->GetMeta(PropertyInfo, sub { $_->attributes->{domProperty}},1);
392 397
393 return (keys %props,keys %{$this->{$_propertyMap}}); 398 return (keys %props,keys %{$this->{$_propertyMap}});
394 } 399 }
395 400
396 sub save { 401 sub save {