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

code cleanup
author cin
date Tue, 07 May 2013 02:19:24 +0400
parents c6d0f889ef87
children 4edd36025051
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Node.pm	Thu May 02 10:43:49 2013 +0400
+++ b/Lib/IMPL/DOM/Node.pm	Tue May 07 02:19:24 2013 +0400
@@ -2,27 +2,32 @@
 use strict;
 use warnings;
 
-use parent qw(IMPL::Object);
+use Scalar::Util qw(weaken);
 
 use IMPL::lang;
 use IMPL::Object::List;
-use IMPL::Class::Property;
-use Scalar::Util qw(weaken);
 
-use IMPL::Exception;
-
-BEGIN {
-    public _direct property nodeName => prop_get;
-    public _direct property document => prop_get;
-    public _direct property isComplex => { get => \&_getIsComplex } ;
-    public _direct property nodeValue => prop_all;
-    public _direct property childNodes => { get => \&_getChildNodes }; # prop_list
-    public _direct property parentNode => prop_get | owner_set;
-    public _direct property schema => prop_get | owner_set;
-    public _direct property schemaSource => prop_get | owner_set;
-    private _direct property _propertyMap => prop_all ;
-    
-}
+use IMPL::Exception();
+use IMPL::Const qw(:prop);
+use IMPL::declare {
+    require => {
+        PropertyInfo => '-IMPL::Class::PropertyInfo'
+    },
+    base => [
+        'IMPL::Object' => undef
+    ],
+    props => [
+        nodeName => PROP_RO | PROP_DIRECT,
+        document => PROP_RO | PROP_DIRECT,
+        isComplex => { get => \&_getIsComplex },
+        nodeValue => PROP_RW | PROP_DIRECT,
+        childNodes => { get => \&_getChildNodes, isList => 1, direct => 1 },
+        parentNode => PROP_RO | PROP_DIRECT,
+        schema => PROP_RO | PROP_DIRECT,
+        schemaSource => PROP_RO | PROP_DIRECT,
+        _propertyMap => PROP_RW | PROP_DIRECT
+    ]
+};
 
 our %Axes = (
     parent => \&selectParent,
@@ -388,7 +393,7 @@
 sub listProperties {
     my ($this) = @_;
     
-    my %props = map {$_->name, 1} $this->GetMeta(typeof IMPL::Class::PropertyInfo, sub { $_->attributes->{domProperty}},1);
+    my %props = map {$_->name, 1} $this->GetMeta(PropertyInfo, sub { $_->attributes->{domProperty}},1);
     
     return (keys %props,keys %{$this->{$_propertyMap}});
 }