BabelObjects
view release on metacpan or search on metacpan
BabelObjects/Runner/Dispatcher.pm view on Meta::CPAN
if ($newfilename ne "") {
close(NEWFILE);
}
}
sub boprint {
my $self = shift;
my $aString = shift;
if ($newfilename ne "") {
print NEWFILE $aString;
} else {
print $aString;
}
}
sub AUTOLOAD {
my $self = shift;
my $type = ref($self) or croak "$self is not an object";
my $name = $AUTOLOAD;
$name =~ s/.*://; # strip fully-qualified portion
unless (exists $self->{_permitted}->{$name} ) {
#croak "Can't access `$name' field in class $type";
# On intercepte ici les erreurs liées aux tentatives d'appel
# des méthodes inexistantes
#$aLog->log("AUTOLOAD : $self = $AUTOLOAD");
return $AUTOLOAD;
}
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
1;
__END__
# Below is the stub of documentation for your module. You better edit it!
=head1 NAME
BabelObjects::Runner::Dispatcher - parses the file and substitutes BO tags.
=head1 SYNOPSIS
use BabelObjects::Runner::Dispatcher;
=head1 DESCRIPTION
Dispatcher parses the file and substitutes all Babel Objects tags by their
value. Tags are of the form : $(aClass.aMethod).
The file is parsed within a web or no web context. When a BO tag is
encountered, the dispatcher looks in the classes.xml file for an element
called aClass. If it finds one, it takes the real class name, loads it and
calls the aMethod on it :
<classes>
<parameter>
<bookmark>BabelObjects::Component::Directory::Bookmark</bookmark>
</parameter>
<parameter>
<test>BabelObjects::Component::Test::BabelObjects::Test</test>
</parameter>
<classes>
Then the result is written on the http output in a web context, or the standart
output in a no web context.
=head1 AUTHOR
Jean-Christophe Kermagoret, jck@BabelObjects.Org (http://www.BabelObjects.Org)
=head1 SEE ALSO
perl(1).
=cut
( run in 3.654 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )