line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Header: /home/fergal/my/cvs/Code-Perl/lib/Code/Perl/Expr/CallMethod.pm,v 1.4 2003/06/17 18:11:41 fergal Exp $ |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Code::Perl::Expr::CallMethod; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base 'Code::Perl::Expr::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
81
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Class::MethodMaker ( |
10
|
1
|
|
|
|
|
7
|
get_set => [qw( -java Object MethodName Args )] |
11
|
1
|
|
|
1
|
|
5
|
); |
|
1
|
|
|
|
|
2
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub eval |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
68
|
my $object = $self->getObject; |
18
|
2
|
|
|
|
|
93
|
my $methodname = $self->getMethodName->eval; |
19
|
2
|
|
|
|
|
78
|
my $args = $self->getArgs; |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
30
|
return $object->eval->$methodname($args->eval); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub perl |
25
|
|
|
|
|
|
|
{ |
26
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
71
|
my $object = $self->getObject->perl; |
29
|
2
|
|
|
|
|
68
|
my $methodname = $self->getMethodName->perl; |
30
|
2
|
|
|
|
|
84
|
my $args = $self->getArgs->perl; |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
25
|
return "($object)->$methodname($args)"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |