Mercurial > pub > Impl
comparison Lib/IMPL/DOM/Schema/Node.pm @ 148:e6447ad85cb4
DOM objects now have a schema and schemaSource properties
RegExp now can launder data
Improved post to DOM transformation (multiple values a now supported)
Added new axes to navigation queries: ancestor and descendant
minor changes and bug fixes
| author | wizard |
|---|---|
| date | Mon, 16 Aug 2010 08:26:44 +0400 |
| parents | 196bf443b5e1 |
| children | 1e7f03414b65 |
comparison
equal
deleted
inserted
replaced
| 147:c2aa10fbb396 | 148:e6447ad85cb4 |
|---|---|
| 16 public _direct property display_no => prop_all; | 16 public _direct property display_no => prop_all; |
| 17 public _direct property display_blame => prop_all; | 17 public _direct property display_blame => prop_all; |
| 18 } | 18 } |
| 19 | 19 |
| 20 our %CTOR = ( | 20 our %CTOR = ( |
| 21 'IMPL::DOM::Node' => sub {my %args = @_; $args{nodeName} ||= 'Node'; %args} | 21 'IMPL::DOM::Node' => sub { |
| 22 my %args = @_; | |
| 23 delete @args{qw( | |
| 24 minOccur | |
| 25 maxOccur | |
| 26 type | |
| 27 name | |
| 28 display | |
| 29 display_no | |
| 30 display_blame | |
| 31 )} ; | |
| 32 $args{nodeName} ||= 'Node'; | |
| 33 %args | |
| 34 } | |
| 22 ); | 35 ); |
| 23 | 36 |
| 24 sub CTOR { | 37 sub CTOR { |
| 25 my ($this,%args) = @_; | 38 my ($this,%args) = @_; |
| 26 | 39 |
| 27 $this->{$minOccur} = defined $args{minOccur} ? $args{minOccur} : 1; | 40 $this->{$minOccur} = defined $args{minOccur} ? $args{minOccur} : 1; |
| 28 $this->{$maxOccur} = defined $args{maxOccur} ? $args{maxOccur} : 1; | 41 $this->{$maxOccur} = defined $args{maxOccur} ? $args{maxOccur} : 1; |
| 29 $this->{$type} = $args{type}; | 42 $this->{$type} = $args{type}; |
| 30 $this->{$name} = $args{name} or die new IMPL::InvalidArgumentException('Argument is required','name'); | 43 $this->{$name} = $args{name} or die new IMPL::InvalidArgumentException('Argument is required','name'); |
| 31 $this->{$display} = $args{display}; | 44 $this->{$display} = $args{display} if $args{display}; |
| 32 $this->{$display_no} = $args{display_no}; | 45 $this->{$display_no} = $args{display_no} if $args{display}; |
| 33 $this->{$display_blame} = $args{display_blame}; | 46 $this->{$display_blame} = $args{display_blame} if $args{display}; |
| 34 } | 47 } |
| 35 | 48 |
| 36 sub Validate { | 49 sub Validate { |
| 37 my ($this,$node) = @_; | 50 my ($this,$node) = @_; |
| 38 | 51 |
| 68 my ($this,$node) = @_; | 81 my ($this,$node) = @_; |
| 69 } | 82 } |
| 70 | 83 |
| 71 =head1 DESCRIPTION | 84 =head1 DESCRIPTION |
| 72 | 85 |
| 73 Базовый класс для элементов схемы. | 86 Базовый класс для элементов схемы. Также позволяет объявлять узлы определенного типа. |
| 87 | |
| 88 =head1 MEMBERS | |
| 89 | |
| 90 =head2 PROPERTIES | |
| 91 | |
| 92 =over | |
| 93 | |
| 94 =item C<[get,set] minOccur> | |
| 95 | |
| 96 C<default: 1>. | |
| 97 | |
| 98 Минимальное количество повторений узла. | |
| 99 | |
| 100 =item C<[get,set] maxOccur> | |
| 101 | |
| 102 C<default: 1>. | |
| 103 | |
| 104 Максимальное количество повторений узла | |
| 105 | |
| 106 =item C<[get,set] type> | |
| 107 | |
| 108 C<default: undef> | |
| 109 | |
| 110 Имя типа из схемы. | |
| 111 | |
| 112 =item C<[get,set] name> | |
| 113 | |
| 114 Имя узла. | |
| 115 | |
| 116 =item C<[get,set] display> | |
| 117 | |
| 118 Имя узла для отображения. | |
| 119 | |
| 120 =item C<[get,set] display_no> | |
| 121 | |
| 122 Имя узла для отображения (родительный падеж). | |
| 123 | |
| 124 =item C<[get,set] display_blame> | |
| 125 | |
| 126 Имя узла для отображения (винительный падеж). | |
| 127 | |
| 128 =back | |
| 74 | 129 |
| 75 =cut | 130 =cut |
