view Lib/IMPL/DOM/Node.pm @ 1:3b418b134d8c

ORM in progress
author Sergey
date Fri, 17 Jul 2009 13:30:46 +0400
parents 03e58a454b20
children e59f44f75f20
line wrap: on
line source

package IMPL::DOM::Node;
use strict;
use warnings;

use base qw(IMPL::Object IMPL::Object::Serializable IMPL::Object::Autofill);

use IMPL::Class::Property;
use IMPL::Class::Property::Direct;
use Scalar::Util qw(weaken);

use IMPL::Exception;

__PACKAGE__->PassThroughArgs;

BEGIN {
    public property nodeName => prop_get | owner_set;
    public property isComplex => prop_get | owner_set;
    public property nodeValue => prop_get | owner_set;
    public property childNodes => prop_get | owner_set| prop_list;
    public property parentNode => prop_get | owner_set;
    private property _propertyMap => prop_all;
}

sub CTOR {
    my ($this,$name) = @_;
    
    $this->nodeName($name) or die new IMPL::InvalidArgumentException("A name is required");
    $this->_propertyMap({});
}

sub insertNode {
    my ($this,$node,$pos) = @_;
}

sub removeNode {
    my ($this,$node) = @_;
}

sub removeAt {
    my ($this,$pos) = @_;
}

sub selectNodes {
    my ($this,$name) = @_;
}

sub setParent {
    my ($this,$parentNode) = @_;
}

sub text {
    my ($this) = @_;
}

sub Property {
    my $this = shift;
    my $name = shift;
    
    if (@_) {
        # set
        return $this->_propertyMap->{$name} = shift;
    } else {
        return $this->_propertyMap->{$name};
    }
}

1;