1package Pod::WSDL::Param;
2use strict;
3use warnings;
4use Pod::WSDL::AUTOLOAD;
5
6our $VERSION = "0.05";
7our @ISA = qw/Pod::WSDL::AUTOLOAD/;
8
9our %FORBIDDEN_METHODS = (
10	name      => {get => 1, set =>  0},
11	type      => {get => 1, set =>  0},
12	paramType => {get => 1, set =>  0},
13	descr     => {get => 1, set =>  0},
14	array     => {get => 1, set =>  0},
15);
16
17sub new {
18	my ($pkg, $str) = @_;
19
20	defined $str or $str = ''; # avoids warnings, dies soon
21	$str =~ s/\s*_(INOUT|IN|OUT)\s*//i or die "Input string '$str' does not begin with '_IN', '_OUT' or '_INOUT'";
22
23	my $paramType = $1;
24
25	my ($name, $type, $descr) = split /\s+/, $str, 3;
26
27	$type ||= ''; # avoids warnings, dies soon
28
29	$type =~ /([\$\@])(.+)/;
30	die "Type '$type' must have structure (\$|@)<typename>, e.g. '\$boolean' or '\@string', not '$type' died" unless $1 and $2;
31
32	bless {
33		_name      => $name,
34		_type      => $2,
35		_paramType => $paramType,
36		_descr     => $descr || '',
37		_array     => $1 eq '@' ? 1 : 0,
38	}, $pkg;
39}
40
411;
42__END__
43
44=head1 NAME
45
46Pod::WSDL::Param - Represents the WSDL pod for a parameter of a method (internal use only)
47
48=head1 SYNOPSIS
49
50  use Pod::WSDL::Param;
51  my $param = new Pod::WSDL::Param('_IN myParam $string This parameter is for blah ...');
52
53=head1 DESCRIPTION
54
55This module is used internally by Pod::WSDL. It is unlikely that you have to interact directly with it. If that is the case, take a look at the code, it is rather simple.
56
57=head1 METHODS
58
59=head2 new
60
61Instantiates a new Pod::WSDL::Param. The method needs one parameter, the _IN, _OUT or _INOUT string from the pod. Please see SYNOPSIS or the section "Pod Syntax" in the description of Pod::WSDL.
62
63=head1 EXTERNAL DEPENDENCIES
64
65  [none]
66
67=head1 EXAMPLES
68
69see Pod::WSDL
70
71=head1 BUGS
72
73see Pod::WSDL
74
75=head1 TODO
76
77see Pod::WSDL
78
79=head1 SEE ALSO
80
81  Pod::WSDL
82
83=head1 AUTHOR
84
85Tarek Ahmed, E<lt>bloerch -the character every email address contains- oelbsk.orgE<gt>
86
87=head1 COPYRIGHT AND LICENSE
88
89Copyright (C) 2006 by Tarek Ahmed
90
91This library is free software; you can redistribute it and/or modify
92it under the same terms as Perl itself, either Perl version 5.8.5 or,
93at your option, any later version of Perl 5 you may have available.
94
95=cut
96