comparison Lib/IMPL/DOM/Schema.pm @ 389:5aff94ba842f

DOM Schema refactoring complete
author cin
date Wed, 12 Feb 2014 13:36:24 +0400
parents 2f16f13b000c
children f23fcb19d3c1
comparison
equal deleted inserted replaced
388:648dfaf642e0 389:5aff94ba842f
17 Property => 'IMPL::DOM::Schema::Property', 17 Property => 'IMPL::DOM::Schema::Property',
18 SwitchNode => 'IMPL::DOM::Schema::SwitchNode', 18 SwitchNode => 'IMPL::DOM::Schema::SwitchNode',
19 Validator => 'IMPL::DOM::Schema::Validator', 19 Validator => 'IMPL::DOM::Schema::Validator',
20 Builder => 'IMPL::DOM::Navigator::Builder', 20 Builder => 'IMPL::DOM::Navigator::Builder',
21 XMLReader => 'IMPL::DOM::XMLReader', # XMLReader references Schema 21 XMLReader => 'IMPL::DOM::XMLReader', # XMLReader references Schema
22 InflateFactory => 'IMPL::DOM::Schema::InflateFactory',
23 Loader => 'IMPL::Code::Loader', 22 Loader => 'IMPL::Code::Loader',
24 StringMap => 'IMPL::Resources::StringLocaleMap' 23 StringMap => 'IMPL::Resources::StringLocaleMap'
25 }, 24 },
26 base => [ 25 base => [
27 'IMPL::DOM::Document' => sub { 26 'IMPL::DOM::Document' => sub {
59 58
60 my $type = $this->{$_typesMap}{$typeName}; 59 my $type = $this->{$_typesMap}{$typeName};
61 return $type if $type; 60 return $type if $type;
62 61
63 foreach my $base ($this->baseSchemas) { 62 foreach my $base ($this->baseSchemas) {
64 last if $type = $base->resolveType($typeName); 63 last if $type = $base->ResolveType($typeName);
65 } 64 }
66 65
67 die IMPL::KeyNotFoundException->new($typeName) 66 die IMPL::KeyNotFoundException->new($typeName)
68 unless $type; 67 unless $type;
69 return $this->{$_typesMap}{$typeName} = $type; 68 return $this->{$_typesMap}{$typeName} = $type;
240 ComplexType->new(type => 'SimpleType', nativeType => 'IMPL::DOM::Schema::SimpleType')->appendRange( 239 ComplexType->new(type => 'SimpleType', nativeType => 'IMPL::DOM::Schema::SimpleType')->appendRange(
241 NodeList->new()->appendRange( 240 NodeList->new()->appendRange(
242 Node->new(name => 'Property', type=>'Property', maxOccur=>'unbounded', minOccur=>0), 241 Node->new(name => 'Property', type=>'Property', maxOccur=>'unbounded', minOccur=>0),
243 AnyNode->new(maxOccur => 'unbounded', minOccur => 0, type=>'Validator') 242 AnyNode->new(maxOccur => 'unbounded', minOccur => 0, type=>'Validator')
244 ), 243 ),
245 Property->new(name => 'type'), 244 Property->new(name => 'type')
246 Property->new(name => 'inflator', optional => 1, inflator => 'IMPL::DOM::Schema::InflateFactory')
247 ), 245 ),
248 ComplexType->new(type => 'SimpleNode', nativeType => 'IMPL::DOM::Schema::SimpleNode')->appendRange( 246 ComplexType->new(type => 'SimpleNode', nativeType => 'IMPL::DOM::Schema::SimpleNode')->appendRange(
249 NodeList->new()->appendRange( 247 NodeList->new()->appendRange(
250 Node->new(name => 'Property', type=>'Property', maxOccur=>'unbounded', minOccur=>0), 248 Node->new(name => 'Property', type=>'Property', maxOccur=>'unbounded', minOccur=>0),
251 AnyNode->new(maxOccur => 'unbounded', minOccur => 0, type=>'Validator') 249 AnyNode->new(maxOccur => 'unbounded', minOccur => 0, type=>'Validator')
252 ), 250 ),
253 Property->new(name => 'name'), 251 Property->new(name => 'name')
254 Property->new(name => 'inflator', optional => 1, inflator => 'IMPL::DOM::Schema::InflateFactory')
255 ), 252 ),
256 ComplexType->new(type => 'Validator', nativeType => 'IMPL::DOM::Schema::Validator')->appendRange( 253 ComplexType->new(type => 'Validator', nativeType => 'IMPL::DOM::Schema::Validator')->appendRange(
257 NodeList->new()->appendRange( 254 NodeList->new()->appendRange(
258 AnyNode->new(maxOccur => 'unbounded', minOccur => 0) 255 AnyNode->new(maxOccur => 'unbounded', minOccur => 0)
259 ) 256 )
260 ), 257 ),
261 ComplexType->new(type => 'Property', nativeType => 'IMPL::DOM::Schema::Property' )->appendRange( 258 ComplexType->new(type => 'Property', nativeType => 'IMPL::DOM::Schema::Property' )->appendRange(
262 NodeList->new()->appendRange( 259 NodeList->new()->appendRange(
263 AnyNode->new(maxOccur => 'unbounded', minOccur => 0) 260 AnyNode->new(maxOccur => 'unbounded', minOccur => 0)
264 ), 261 ),
265 Property->new(name => 'name'), 262 Property->new(name => 'name')
266 Property->new(name => 'inflator', optional => 1, inflator => 'IMPL::DOM::Schema::InflateFactory')
267 ), 263 ),
268 SimpleType->new(type => 'Node', nativeType => 'IMPL::DOM::Schema::Node')->appendRange( 264 SimpleType->new(type => 'Node', nativeType => 'IMPL::DOM::Schema::Node')->appendRange(
269 Property->new(name => 'name'), 265 Property->new(name => 'name'),
270 Property->new(name => 'type') 266 Property->new(name => 'type')
271 ), 267 ),