| 1 | 10 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 10 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 10 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 10 | ▶ | no warnings qw(uninitialized); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | |||||||||||||
| 7 | #====================================================================== | ||||||||||||
| 8 | # White space separated tokens. | ||||||||||||
| 9 | #====================================================================== | ||||||||||||
| 10 | |||||||||||||
| 11 | package XML::Pastor::Builtin::List; | ||||||||||||
| 12 | |||||||||||||
| 13 | 10 | ▶ | use XML::Pastor::Builtin::SimpleType; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | 10 | our @ISA = qw(XML::Pastor::Builtin::SimpleType); | |||||||||||
| 16 | |||||||||||||
| 17 | #----------------------------------------------------------------- | ||||||||||||
| 18 | 0 | ▶ | sub toList { | ||||||||||
|
Subroutine
toList: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 19 | 0 | my $self = shift; | |||||||||||
| 20 | 0 | my $value = $self->__value() . ""; | |||||||||||
| 21 | 0 | my @list = split /\s+/, $value; | |||||||||||
| 22 | 0 | ▶ | return (wantarray ? (@list) : [@list]); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | #----------------------------------------------------------------- | ||||||||||||
| 26 | 0 | ▶ | sub setFromList { | ||||||||||
|
Subroutine
setFromList: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 27 | 0 | my $self = shift; | |||||||||||
| 28 | 0 | return $self->__value(join (' ', @_)); | |||||||||||
| 29 | } | ||||||||||||
| 30 | |||||||||||||
| 31 | #----------------------------------------------------------------- | ||||||||||||
| 32 | # A CONSTRUCTOR | ||||||||||||
| 33 | #----------------------------------------------------------------- | ||||||||||||
| 34 | 0 | ▶ | sub fromList { | ||||||||||
|
Subroutine
fromList: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 35 | 0 | my $self = shift->new(); | |||||||||||
| 36 | 0 | return $self->setFromList(@_); | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | #-------------------------------------------------------------- | ||||||||||||
| 40 | 0 | ▶ | sub xml_validate { | ||||||||||
|
Subroutine
xml_validate: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||
| 41 | 0 | my $self = shift; | |||||||||||
| 42 | 0 | ▶ | my $path = shift || ''; | ||||||||||
|
Condition0%0/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 43 | 0 | my $value = $self->__value; | |||||||||||
| 44 | 0 | my $type = $self->XmlSchemaType(); | |||||||||||
| 45 | 0 | ▶ | my $class = $type->itemClass || "XML::Pastor::SimpleType"; | ||||||||||
|
Condition0%0/2
$type->itemClass || 'XML::Pastor::SimpleType'
MC/DC0%0/1
$type->itemClass || 'XML::Pastor::SimpleType'
$type->itemClass
Truth table0%0/2
A
A= $type->itemClass
| |||||||||||||
| 46 | |||||||||||||
| 47 | 0 | ▶ | unless (UNIVERSAL::can($class,"xml_validate")) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 48 | 0 | return $self->xml_validate_further(@_); | |||||||||||
| 49 | } | ||||||||||||
| 50 | |||||||||||||
| 51 | 0 | my @parts = $self->toList(); | |||||||||||
| 52 | |||||||||||||
| 53 | 0 | foreach my $part (@parts) { | |||||||||||
| 54 | 0 | my $object = $class->new(__value => $part); | |||||||||||
| 55 | 0 | ▶ | $object->xml_validate(@_) or die "Pastor : Validate : $path : List part '$part' does not validate against class '$class' in list '$value'!"; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 56 | } | ||||||||||||
| 57 | 0 | return $self->xml_validate_further(@_); | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | |||||||||||||
| 61 | 10 | 1; | |||||||||||
| 62 | |||||||||||||
| 63 | __END__ | ||||||||||||