File Coverage

blib/lib/SOAP/WSDL/Definitions.pm
Criterion Covered Total %
statement 23 24 95.8
branch 3 4 75.0
condition n/a
subroutine 8 8 100.0
pod n/a
total 34 36 94.4


line stmt bran cond sub pod time code
1             package SOAP::WSDL::Definitions;
2 1     1   1022 use strict;
  1         3  
  1         50  
3 1     1   28 use warnings;
  1         2  
  1         41  
4 1     1   6 use List::Util qw(first);
  1         1  
  1         112  
5 1     1   6 use Class::Std::Fast::Storable;
  1         14  
  1         13  
6 1     1   301 use base qw(SOAP::WSDL::Base);
  1         2  
  1         391  
7              
8             our $VERSION = $SOAP::WSDL::VERSION;
9              
10             my %types_of :ATTR(:name :default<[]>);
11             my %message_of :ATTR(:name :default<[]>);
12             my %portType_of :ATTR(:name :default<[]>);
13             my %binding_of :ATTR(:name :default<[]>);
14             my %service_of :ATTR(:name :default<[]>);
15             my %namespace_of :ATTR(:name :default<()>);
16              
17             # must be attr for Class::Std::Fast::Storable
18             #my %attributes_of :ATTR();
19             my %attributes_of = (
20             binding => \%binding_of,
21             message => \%message_of,
22             portType => \%portType_of,
23             service => \%service_of,
24             );
25              
26             # Function factory - we could be writing this method for all %attribute
27             # keys, too, but that's just C&P (eehm, Copy & Paste...)
28             BLOCK: {
29             foreach my $method(keys %attributes_of ) {
30 1     1   7 no strict qw/refs/; ## no critic ProhibitNoStrict
  1         2  
  1         330  
31             *{ "find_$method" } = sub {
32 3     3   1245 my ($self, @args_from) = @_;
33 3 50       10 @args_from = @{ $args_from[0] } if ref $args_from[0] eq 'ARRAY';
  0         0  
34             return first {
35 8 100   8   110 $_->get_targetNamespace() eq $args_from[0]
36             && $_->get_name() eq $args_from[1]
37             }
38 3         12 @{ $attributes_of{ $method }->{ ident $self } };
  3         11  
39             };
40             }
41             }
42              
43              
44             1;
45              
46             =pod
47              
48             =head1 NAME
49              
50             SOAP::WSDL::Definitions - model a WSDL EdefinitionsE element
51              
52             =head1 DESCRIPTION
53              
54             =head1 METHODS
55              
56             =head2 first_service get_service set_service push_service
57              
58             Accessors/Mutators for accessing / setting the EserviceE child
59             element(s).
60              
61             =head2 find_service
62              
63             Returns the service matching the namespace/localname pair passed as arguments.
64              
65             my $service = $wsdl->find_service($namespace, $localname);
66              
67             =head2 first_binding get_binding set_binding push_binding
68              
69             Accessors/Mutators for accessing / setting the EbindingE child
70             element(s).
71              
72             =head2 find_binding
73              
74             Returns the binding matching the namespace/localname pair passed as arguments.
75              
76             my $binding = $wsdl->find_binding($namespace, $localname);
77              
78             =head2 first_portType get_portType set_portType push_portType
79              
80             Accessors/Mutators for accessing / setting the EportTypeE child
81             element(s).
82              
83             =head2 find_portType
84              
85             Returns the portType matching the namespace/localname pair passed as arguments.
86              
87             my $portType = $wsdl->find_portType($namespace, $localname);
88              
89             =head2 first_message get_message set_message push_message
90              
91             Accessors/Mutators for accessing / setting the EmessageE child
92             element(s).
93              
94             =head2 find_message
95              
96             Returns the message matching the namespace/localname pair passed as arguments.
97              
98             my $message = $wsdl->find_message($namespace, $localname);
99              
100             =head2 first_types get_types set_types push_types
101              
102             Accessors/Mutators for accessing / setting the EtypesE child
103             element(s).
104              
105             =head1 LICENSE AND COPYRIGHT
106              
107             Copyright 2004-2007 Martin Kutter.
108              
109             This file is part of SOAP-WSDL. You may distribute/modify it under
110             the same terms as perl itself
111              
112             =head1 AUTHOR
113              
114             Martin Kutter Emartin.kutter fen-net.deE
115              
116             =head1 REPOSITORY INFORMATION
117              
118             $Rev: 851 $
119             $LastChangedBy: kutterma $
120             $Id: Definitions.pm 851 2009-05-15 22:45:18Z kutterma $
121             $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Definitions.pm $
122              
123             =cut
124