| 1 | #============================================================= -*-perl-*- | |||||||||||||||||||||||||||||||
| 2 | # | |||||||||||||||||||||||||||||||
| 3 | # XML::Schema::Handler | |||||||||||||||||||||||||||||||
| 4 | # | |||||||||||||||||||||||||||||||
| 5 | # DESCRIPTION | |||||||||||||||||||||||||||||||
| 6 | # Module implementing a base class parser handler. | |||||||||||||||||||||||||||||||
| 7 | # | |||||||||||||||||||||||||||||||
| 8 | # AUTHOR | |||||||||||||||||||||||||||||||
| 9 | # Andy Wardley <abw@kfs.org> | |||||||||||||||||||||||||||||||
| 10 | # | |||||||||||||||||||||||||||||||
| 11 | # COPYRIGHT | |||||||||||||||||||||||||||||||
| 12 | # Copyright (C) 2001 Canon Research Centre Europe Ltd. | |||||||||||||||||||||||||||||||
| 13 | # All Rights Reserved. | |||||||||||||||||||||||||||||||
| 14 | # | |||||||||||||||||||||||||||||||
| 15 | # This module is free software; you can redistribute it and/or | |||||||||||||||||||||||||||||||
| 16 | # modify it under the same terms as Perl itself. | |||||||||||||||||||||||||||||||
| 17 | # | |||||||||||||||||||||||||||||||
| 18 | # REVISION | |||||||||||||||||||||||||||||||
| 19 | # $Id: Handler.pm,v 1.1.1.1 2001/08/29 14:30:17 abw Exp $ | |||||||||||||||||||||||||||||||
| 20 | # | |||||||||||||||||||||||||||||||
| 21 | #======================================================================== | |||||||||||||||||||||||||||||||
| 22 | ||||||||||||||||||||||||||||||||
| 23 | package XML::Schema::Handler; | |||||||||||||||||||||||||||||||
| 24 | ||||||||||||||||||||||||||||||||
| 25 | 2 | ▶ | use strict; | |||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | use XML::Schema::Scheduler; | |||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | use base qw( XML::Schema::Scheduler ); | |||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||
| 28 | 2 | ▶ | use vars qw( $VERSION $DEBUG $ERROR @MANDATORY @OPTIONAL ); | |||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||
| 29 | ||||||||||||||||||||||||||||||||
| 30 | 2 | $VERSION = sprintf("%d.%02d", q$Revision: 1.1.1.1 $ =~ /(\d+)\.(\d+)/); | ||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | $DEBUG = 0 unless defined $DEBUG; | |||||||||||||||||||||||||||||
|
Branch: 1 branch
| ||||||||||||||||||||||||||||||||
| 32 | 2 | $ERROR = ''; | ||||||||||||||||||||||||||||||
| 33 | ||||||||||||||||||||||||||||||||
| 34 | #@MANDATORY = qw( type ); | |||||||||||||||||||||||||||||||
| 35 | 2 | @OPTIONAL = qw( name type ); | ||||||||||||||||||||||||||||||
| 36 | ||||||||||||||||||||||||||||||||
| 37 | ||||||||||||||||||||||||||||||||
| 38 | #------------------------------------------------------------------------ | |||||||||||||||||||||||||||||||
| 39 | # init() | |||||||||||||||||||||||||||||||
| 40 | #------------------------------------------------------------------------ | |||||||||||||||||||||||||||||||
| 41 | ||||||||||||||||||||||||||||||||
| 42 | 5 | ▶ | sub init { | |||||||||||||||||||||||||||||
|
Subroutine
init: called CC=7 SCAR=20.6
Pod
documented
| ||||||||||||||||||||||||||||||||
| 43 | 5 | my ($self, $config) = @_; | ||||||||||||||||||||||||||||||
| 44 | 5 | my ($name, $value); | ||||||||||||||||||||||||||||||
| 45 | ||||||||||||||||||||||||||||||||
| 46 | 5 | ▶ | $self->init_scheduler($config) | |||||||||||||||||||||||||||||
|
Branch: 1 branch
| ||||||||||||||||||||||||||||||||
| 47 | || return; | |||||||||||||||||||||||||||||||
| 48 | ||||||||||||||||||||||||||||||||
| 49 | my ($mand, $option) | |||||||||||||||||||||||||||||||
| 50 | 5 | = @{ $self->_baseargs( qw( @MANDATORY @OPTIONAL ) ) }; | ||||||||||||||||||||||||||||||
| 51 | ||||||||||||||||||||||||||||||||
| 52 | 5 | ▶ | $self->_mandatory($mand, $config) | |||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
@$mand && ($self->_mandatory($mand, $config) || (return))
$self->_mandatory($mand, $config) or return
MC/DC0%0/2
@$mand && ($self->_mandatory($mand, $config) || (return))
@$mand
$self->_mandatory($mand, $config)
Truth table66%2/3
A && B
A= @$mandB= $self->_mandatory($mand, $config)
| ||||||||||||||||||||||||||||||||
| 53 | || return if @$mand; | |||||||||||||||||||||||||||||||
| 54 | ||||||||||||||||||||||||||||||||
| 55 | 4 | ▶ | $self->_optional($option, $config) | |||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
@$option && ($self->_optional($option, $config) || (return))
$self->_optional($option, $config) or return
MC/DC0%0/2
@$option && ($self->_optional($option, $config) || (return))
@$option
$self->_optional($option, $config)
Truth table0%0/3
A && B
A= @$optionB= $self->_optional($option, $config)
| ||||||||||||||||||||||||||||||||
| 56 | || return if @$option; | |||||||||||||||||||||||||||||||
| 57 | ||||||||||||||||||||||||||||||||
| 58 | 4 | ▶ | $self->{ name } ||= '<anon>'; | |||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"name"} ||= "<anon>"
MC/DC0%0/1
$self->{"name"} ||= "<anon>"
$self->{"name"}
Truth table50%1/2
A
A= $self->{"name"}
| ||||||||||||||||||||||||||||||||
| 59 | ||||||||||||||||||||||||||||||||
| 60 | 4 | return $self; | ||||||||||||||||||||||||||||||
| 61 | } | |||||||||||||||||||||||||||||||
| 62 | ||||||||||||||||||||||||||||||||
| 63 | ||||||||||||||||||||||||||||||||
| 64 | #------------------------------------------------------------------------ | |||||||||||||||||||||||||||||||
| 65 | # accessor methods | |||||||||||||||||||||||||||||||
| 66 | #------------------------------------------------------------------------ | |||||||||||||||||||||||||||||||
| 67 | ||||||||||||||||||||||||||||||||
| 68 | 2 | ▶ | sub type { | |||||||||||||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| ||||||||||||||||||||||||||||||||
| 69 | 2 | my $self = shift; | ||||||||||||||||||||||||||||||
| 70 | 2 | return $self->{ type }; | ||||||||||||||||||||||||||||||
| 71 | } | |||||||||||||||||||||||||||||||
| 72 | ||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | sub name { | |||||||||||||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
undocumented
| ||||||||||||||||||||||||||||||||
| 74 | 0 | my $self = shift; | ||||||||||||||||||||||||||||||
| 75 | 0 | return $self->{ name }; | ||||||||||||||||||||||||||||||
| 76 | } | |||||||||||||||||||||||||||||||
| 77 | ||||||||||||||||||||||||||||||||
| 78 | ||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub ID { | |||||||||||||||||||||||||||||
|
Subroutine
ID: not called CC=1 SCAR=6.9
Pod
undocumented
| ||||||||||||||||||||||||||||||||
| 80 | 0 | my $self = shift; | ||||||||||||||||||||||||||||||
| 81 | 0 | return "Handler[$self->{ name }]"; | ||||||||||||||||||||||||||||||
| 82 | } | |||||||||||||||||||||||||||||||
| 83 | ||||||||||||||||||||||||||||||||
| 84 | 2 | 1; | ||||||||||||||||||||||||||||||
| 85 | ||||||||||||||||||||||||||||||||
| 86 | __END__ | |||||||||||||||||||||||||||||||