annotate Lib/IMPL/DOM/Transform.pm @ 250:129e48bb5afb

DOM refactoring ObjectToDOM methods are virtual QueryToDOM uses inflators Fixed transform for the complex values in the ObjectToDOM QueryToDOM doesn't allow to use complex values (HASHes) as values for nodes (overpost problem)
author sergey
date Wed, 07 Nov 2012 04:17:53 +0400
parents d1676be8afcc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
1 package IMPL::DOM::Transform;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
4
166
4267a2ac3d46 Added Class::Template,
wizard
parents: 148
diff changeset
5 use parent qw(IMPL::Transform);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
6
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
7 __PACKAGE__->PassThroughArgs;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
8
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
9 sub GetClassForObject {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
10 my ($this,$object) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
11
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
12 if (my $class = ref $object) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
13 if (UNIVERSAL::isa($object,'IMPL::DOM::Node')) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
14 return $object->nodeName;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
15 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
16 return $class;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
17 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
18 } else {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
19 return undef;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
20 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
21 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
22
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
23 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
24
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
25 __END__
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
26
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
27 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
28
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
29 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
30
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 166
diff changeset
31 Преобразование для DOM документа, использует имя узла для применения подходящего преобразования.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
32
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 38
diff changeset
33 =cut