2 |
## $Id$ |
## $Id$ |
3 |
## -------------------------------------------------------------------------------- |
## -------------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.4 2003/02/20 18:42:45 joko |
6 |
|
## renamed modules |
7 |
|
## |
8 |
|
## Revision 1.3 2003/02/09 04:50:32 joko |
9 |
|
## - purged old code |
10 |
|
## |
11 |
|
## Revision 1.2 2002/12/27 16:02:39 joko |
12 |
|
## - object constructor |
13 |
|
## + now utilizing DesignPattern::Object |
14 |
|
## + use Data::Query::Element::LV |
15 |
|
## |
16 |
## Revision 1.1 2002/12/23 04:23:24 joko |
## Revision 1.1 2002/12/23 04:23:24 joko |
17 |
## + initial check-in |
## + initial check-in |
18 |
## |
## |
24 |
use strict; |
use strict; |
25 |
use warnings; |
use warnings; |
26 |
|
|
27 |
use base 'DesignPattern::Object::Logger'; |
use base qw( |
28 |
|
DesignPattern::Object |
29 |
|
DesignPattern::Logger |
30 |
|
); |
31 |
|
|
32 |
|
|
33 |
use Data::Dumper; |
use Data::Dumper; |
34 |
|
|
35 |
use Regexp::Group; |
use Regexp::Group; |
|
use libp qw( mkObject ); |
|
36 |
use Data::Compare::Struct qw( isEmpty ); |
use Data::Compare::Struct qw( isEmpty ); |
37 |
|
|
38 |
# ------------ common perl object constructor ------------ |
use Data::Query::Element::LV; |
|
sub new { |
|
|
my $invocant = shift; |
|
|
my $class = ref($invocant) || $invocant; |
|
|
my @args = (); |
|
|
@_ && (@args = @_); |
|
|
#$logger->debug( __PACKAGE__ . "->new( @args )" ); # this is not "common"! |
|
|
my $self = { @_ }; |
|
|
bless $self, $class; |
|
|
$self->{caller} = caller; |
|
|
|
|
|
#print Dumper(caller(2)); |
|
|
#exit; |
|
|
|
|
|
$self->_init(); |
|
|
return $self; |
|
|
} |
|
39 |
|
|
40 |
sub _init { |
sub _init { |
41 |
my $self = shift; |
my $self = shift; |
42 |
|
|
43 |
#print Dumper($self->{options}->getOptions()); |
if ($self->{options}) { |
44 |
|
$self->{__options} = $self->{options}; |
45 |
|
delete $self->{options}; |
46 |
|
my $possible_keys = $self->{__options}->getPossibleOptionKeys(); |
47 |
|
my $options = $self->{__options}->getOptions(); |
48 |
|
foreach (@$possible_keys) { |
49 |
|
$self->{$_} = Data::Query::Element::LV->new($options->{$_}); |
50 |
|
} |
51 |
|
} |
52 |
|
|
53 |
} |
} |
54 |
|
|
55 |
sub getOptions { |
sub getOptions { |
56 |
my $self = shift; |
my $self = shift; |
57 |
return $self->{options}->getOptions(); |
return $self->{__options}->getOptions(); |
58 |
} |
} |
59 |
|
|
60 |
1; |
1; |