| 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 | package XML::Pastor::Builtin::Union; | ||||||||||||
| 9 | |||||||||||||
| 10 | 10 | ▶ | use XML::Pastor::Builtin::SimpleType; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | 10 | our @ISA = qw(XML::Pastor::Builtin::SimpleType); | |||||||||||
| 13 | |||||||||||||
| 14 | #-------------------------------------------------------------- | ||||||||||||
| 15 | 0 | ▶ | sub xml_validate { | ||||||||||
|
Subroutine
xml_validate: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||
| 16 | 0 | my $self = shift; | |||||||||||
| 17 | 0 | ▶ | my $path = shift || ''; | ||||||||||
|
Condition0%0/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 18 | 0 | my $type = $self->XmlSchemaType(); | |||||||||||
| 19 | 0 | my $value = $self->__value; | |||||||||||
| 20 | 0 | ▶ | my $members = $type->memberClasses || []; | ||||||||||
|
Condition0%0/2
$type->memberClasses || []
MC/DC0%0/1
$type->memberClasses || []
$type->memberClasses
Truth table0%0/2
A
A= $type->memberClasses
| |||||||||||||
| 21 | |||||||||||||
| 22 | 0 | ▶ | unless (@$members) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 0 | return 1; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 0 | foreach my $class (@$members) { | |||||||||||
| 27 | 0 | ▶ | if (UNIVERSAL::can($class,"xml_validate")) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 28 | 0 | my $object = $class->new(__value => $value); | |||||||||||
| 29 | 0 | ▶ | if ($object->xml_validate(@_)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | return 1; | |||||||||||
| 31 | } | ||||||||||||
| 32 | } | ||||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 0 | die "Pastor : Validate : $path : None of the union members validate value '$value'"; | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 10 | 1; | |||||||||||
| 39 | |||||||||||||
| 40 | __END__ | ||||||||||||