annotate Lib/Form/Transform.pm @ 37:c2e7f7c96bcd

performance improvements, DOM reworked (a little)
author Sergey
date Mon, 23 Nov 2009 00:59:06 +0300
parents 03e58a454b20
children 16ada169ca75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 package Form::Transform;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use warnings;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4 use base qw(IMPL::Transform);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7 my ($this) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9 $this->superCTOR(
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10 Templates => {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 'Form::Container' => sub { my $this = shift; $this->TransformContainer(@_); },
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12 'Form' => sub { my $this = shift; $this->TransformContainer(@_); }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 },
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14 Default => \&TransformItem
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
15 );
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
16 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
17
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
18 sub TransformContainer {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
19 my ($this,$container) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
20 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
21
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
22 sub TransformItem {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
23 my ($this,$item) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
24 return $item->isEmpty ? undef : $item->Value;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
25 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
26
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
27
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
28
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
29 1;