| 2 |
## $Id$ |
## $Id$ |
| 3 |
## -------------------------------------------------------------------------------- |
## -------------------------------------------------------------------------------- |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.5 2003/03/27 15:31:01 joko |
| 6 |
|
## fixes to modules regarding new namespace(s) below Data::Mungle::* |
| 7 |
|
## |
| 8 |
|
## Revision 1.4 2003/02/20 18:42:45 joko |
| 9 |
|
## renamed modules |
| 10 |
|
## |
| 11 |
|
## Revision 1.3 2003/02/09 04:50:32 joko |
| 12 |
|
## - purged old code |
| 13 |
|
## |
| 14 |
|
## Revision 1.2 2002/12/27 16:02:39 joko |
| 15 |
|
## - object constructor |
| 16 |
|
## + now utilizing DesignPattern::Object |
| 17 |
|
## + use Data::Query::Element::LV |
| 18 |
|
## |
| 19 |
## Revision 1.1 2002/12/23 04:23:24 joko |
## Revision 1.1 2002/12/23 04:23:24 joko |
| 20 |
## + initial check-in |
## + initial check-in |
| 21 |
## |
## |
| 27 |
use strict; |
use strict; |
| 28 |
use warnings; |
use warnings; |
| 29 |
|
|
| 30 |
use base 'DesignPattern::Object::Logger'; |
use base qw( |
| 31 |
|
DesignPattern::Object |
| 32 |
|
DesignPattern::Logger |
| 33 |
|
); |
| 34 |
|
|
| 35 |
|
|
| 36 |
use Data::Dumper; |
use Data::Dumper; |
| 37 |
|
|
| 38 |
use Regexp::Group; |
use Regexp::Group; |
| 39 |
use libp qw( mkObject ); |
use Data::Mungle::Compare::Struct qw( isEmpty ); |
|
use Data::Compare::Struct qw( isEmpty ); |
|
| 40 |
|
|
| 41 |
# ------------ 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; |
|
|
} |
|
| 42 |
|
|
| 43 |
sub _init { |
sub _init { |
| 44 |
my $self = shift; |
my $self = shift; |
| 45 |
|
|
| 46 |
#print Dumper($self->{options}->getOptions()); |
if ($self->{options}) { |
| 47 |
|
$self->{__options} = $self->{options}; |
| 48 |
|
delete $self->{options}; |
| 49 |
|
my $possible_keys = $self->{__options}->getPossibleOptionKeys(); |
| 50 |
|
my $options = $self->{__options}->getOptions(); |
| 51 |
|
foreach (@$possible_keys) { |
| 52 |
|
$self->{$_} = Data::Query::Element::LV->new($options->{$_}); |
| 53 |
|
} |
| 54 |
|
} |
| 55 |
|
|
| 56 |
} |
} |
| 57 |
|
|
| 58 |
sub getOptions { |
sub getOptions { |
| 59 |
my $self = shift; |
my $self = shift; |
| 60 |
return $self->{options}->getOptions(); |
return $self->{__options}->getOptions(); |
| 61 |
} |
} |
| 62 |
|
|
| 63 |
1; |
1; |